forked from sachabruttin/FluentRibbonTest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml
77 lines (63 loc) · 3.2 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<Fluent:RibbonWindow x:Class="FluentRibbonTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="urn:fluent-ribbon"
xmlns:fluentribbontest="clr-namespace:FluentRibbonTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Title="My first RibbonWindow"
Width="800"
Height="600">
<Fluent:RibbonWindow.Resources>
<Fluent:EqualsToVisibilityConverter x:Key="equalsToVisiblityConverter" />
</Fluent:RibbonWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Fluent:Ribbon Grid.Row="0">
<!--Backstage-->
<Fluent:Ribbon.Menu>
<Fluent:Backstage>
</Fluent:Backstage>
</Fluent:Ribbon.Menu>
<!--Contextual Tab Groups-->
<Fluent:Ribbon.ContextualGroups>
<Fluent:RibbonContextualTabGroup x:Name="toolsGroup"
Header="Binded"
Visibility="{Binding IsTabGroupVisible, Converter={StaticResource boolToVisibilityConverter}}"
Background="Red"
BorderBrush="Red" />
<Fluent:RibbonContextualTabGroup x:Name="visibleGroup"
Header="Not Binding"
Visibility="Visible"
Background="Green"
BorderBrush="Green" />
</Fluent:Ribbon.ContextualGroups>
<!--Tabs-->
<Fluent:RibbonTabItem Header="Home">
<Fluent:RibbonGroupBox Header="Group">
<Fluent:Button Header="Show/Hide Tab"
LargeIcon="{StaticResource DocumentIcon}"
Command="{Binding ShowHideTab}"/>
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>
<!--Contextual Tabs-->
<Fluent:RibbonTabItem Header="Contextual Group"
Group="{Binding Source={x:Reference toolsGroup}}">
<Fluent:RibbonGroupBox Header="Box 1">
<Fluent:ComboBox Header="Check Me" />
</Fluent:RibbonGroupBox>
<Fluent:RibbonGroupBox Header="Box 2">
<Fluent:ComboBox Header="Check Me Too" />
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>
<Fluent:RibbonTabItem Header="Contextual Group"
Group="{Binding Source={x:Reference visibleGroup}}">
</Fluent:RibbonTabItem>
</Fluent:Ribbon>
<TextBlock Text="Is visible!" Grid.Row="1"
Visibility="{Binding IsTabGroupVisible, Converter={StaticResource boolToVisibilityConverter}}"
/>
</Grid>
</Fluent:RibbonWindow>