-
-
Notifications
You must be signed in to change notification settings - Fork 521
/
RibbonWindowWithBackgroundImage.xaml
67 lines (59 loc) · 3.15 KB
/
RibbonWindowWithBackgroundImage.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
<fluent:RibbonWindow x:Class="FluentTest.RibbonWindowWithBackgroundImage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:FluentTest.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:fluent="urn:fluent-ribbon"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="RibbonWindowWithBackgroundImage"
Width="800"
Height="600"
TitleBackground="Transparent"
TitleForeground="Black"
mc:Ignorable="d">
<fluent:RibbonWindow.Resources>
<converters:BackgroundImageViewportConverter x:Key="BackgroundImageViewportConverter" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Background" Color="Transparent" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Foreground" Color="Black" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Background" Color="{DynamicResource Fluent.Ribbon.Colors.White}" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground" Color="Black" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Foreground" Color="Black" />
</fluent:RibbonWindow.Resources>
<Window.Background>
<ImageBrush AlignmentX="Right"
AlignmentY="Top"
ImageSource="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/banner.png"
Stretch="Fill"
TileMode="None"
Viewport="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={StaticResource BackgroundImageViewportConverter}}"
ViewportUnits="Absolute" />
</Window.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<fluent:Ribbon Background="Transparent">
<fluent:Ribbon.Menu>
<fluent:Backstage />
</fluent:Ribbon.Menu>
<fluent:RibbonTabItem Header="First">
<fluent:RibbonGroupBox Header="First">
<fluent:Button Header="First" />
</fluent:RibbonGroupBox>
</fluent:RibbonTabItem>
<fluent:RibbonTabItem Header="Second">
<fluent:RibbonGroupBox Header="Second">
<fluent:Button Header="Second" />
</fluent:RibbonGroupBox>
</fluent:RibbonTabItem>
</fluent:Ribbon>
<Grid Grid.Row="1"
Background="{DynamicResource Fluent.Ribbon.Brushes.White}">
<TextBlock Margin="5"
TextWrapping="Wrap">
This sample shows how to use a background image for the titlebar.
</TextBlock>
</Grid>
</Grid>
</fluent:RibbonWindow>