Skip to content

Commit

Permalink
Adding requirements for #435 and #431
Browse files Browse the repository at this point in the history
Also deleting various images and screenshots
  • Loading branch information
batzen committed Jul 22, 2017
1 parent c861b6f commit fb3bfd4
Show file tree
Hide file tree
Showing 54 changed files with 488 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace FluentTest.Converters
{
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

public class BackgroundImageViewportConverter : IValueConverter
{
#region IValueConverter Members

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return new Rect(0, 0, (double)value, 46);
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

#endregion
}
}
25 changes: 20 additions & 5 deletions Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<Compile Include="..\Shared\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Converters\BackgroundImageViewportConverter.cs" />
<Compile Include="RibbonWindowWithBackgroundImage.xaml.cs">
<DependentUpon>RibbonWindowWithBackgroundImage.xaml</DependentUpon>
</Compile>
<Compile Include="RibbonWindowColorized.xaml.cs">
<DependentUpon>RibbonWindowColorized.xaml</DependentUpon>
</Compile>
<Compile Include="Commanding\IRelayCommand.cs" />
<Compile Include="Commanding\RelayCommand.cs" />
<Compile Include="Converters\UniqueGroupNameConverter.cs" />
Expand Down Expand Up @@ -111,6 +118,14 @@
<Compile Include="ViewModels\IssueRepros\ThemeManagerFromThread.cs" />
<Compile Include="ViewModels\MainViewModel.cs" />
<Compile Include="ViewModels\ViewModel.cs" />
<Page Include="RibbonWindowWithBackgroundImage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="RibbonWindowColorized.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Images\VectorIcons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -235,11 +250,6 @@
<ItemGroup>
<Resource Include="Images\GalleryLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\BlackTheme.png" />
<Resource Include="Images\BlueTheme.png" />
<Resource Include="Images\SilverTheme.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Blue.png" />
<Resource Include="Images\BlueLarge.png" />
Expand All @@ -258,6 +268,11 @@
<Resource Include="Images\Yellow.png" />
<Resource Include="Images\YellowLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Images\banner.png">
<Link>Images\banner.png</Link>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
25 changes: 20 additions & 5 deletions Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.5.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<Compile Include="..\Shared\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Converters\BackgroundImageViewportConverter.cs" />
<Compile Include="RibbonWindowWithBackgroundImage.xaml.cs">
<DependentUpon>RibbonWindowWithBackgroundImage.xaml</DependentUpon>
</Compile>
<Compile Include="RibbonWindowColorized.xaml.cs">
<DependentUpon>RibbonWindowColorized.xaml</DependentUpon>
</Compile>
<Compile Include="Commanding\IRelayCommand.cs" />
<Compile Include="Commanding\RelayCommand.cs" />
<Compile Include="Converters\UniqueGroupNameConverter.cs" />
Expand Down Expand Up @@ -111,6 +118,14 @@
<Compile Include="ViewModels\IssueRepros\ThemeManagerFromThread.cs" />
<Compile Include="ViewModels\MainViewModel.cs" />
<Compile Include="ViewModels\ViewModel.cs" />
<Page Include="RibbonWindowWithBackgroundImage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="RibbonWindowColorized.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Images\VectorIcons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -235,11 +250,6 @@
<ItemGroup>
<Resource Include="Images\GalleryLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\BlackTheme.png" />
<Resource Include="Images\BlueTheme.png" />
<Resource Include="Images\SilverTheme.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Blue.png" />
<Resource Include="Images\BlueLarge.png" />
Expand All @@ -258,6 +268,11 @@
<Resource Include="Images\Yellow.png" />
<Resource Include="Images\YellowLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Images\banner.png">
<Link>Images\banner.png</Link>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
25 changes: 20 additions & 5 deletions Fluent.Ribbon.Showcase/Fluent.Ribbon.Showcase.NET 4.6.2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
<Compile Include="..\Shared\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Converters\BackgroundImageViewportConverter.cs" />
<Compile Include="RibbonWindowWithBackgroundImage.xaml.cs">
<DependentUpon>RibbonWindowWithBackgroundImage.xaml</DependentUpon>
</Compile>
<Compile Include="RibbonWindowColorized.xaml.cs">
<DependentUpon>RibbonWindowColorized.xaml</DependentUpon>
</Compile>
<Compile Include="Commanding\IRelayCommand.cs" />
<Compile Include="Commanding\RelayCommand.cs" />
<Compile Include="Converters\UniqueGroupNameConverter.cs" />
Expand Down Expand Up @@ -111,6 +118,14 @@
<Compile Include="ViewModels\IssueRepros\ThemeManagerFromThread.cs" />
<Compile Include="ViewModels\MainViewModel.cs" />
<Compile Include="ViewModels\ViewModel.cs" />
<Page Include="RibbonWindowWithBackgroundImage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="RibbonWindowColorized.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Images\VectorIcons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -235,11 +250,6 @@
<ItemGroup>
<Resource Include="Images\GalleryLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\BlackTheme.png" />
<Resource Include="Images\BlueTheme.png" />
<Resource Include="Images\SilverTheme.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Blue.png" />
<Resource Include="Images\BlueLarge.png" />
Expand All @@ -258,6 +268,11 @@
<Resource Include="Images\Yellow.png" />
<Resource Include="Images\YellowLarge.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="..\Images\banner.png">
<Link>Images\banner.png</Link>
</Resource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 5 additions & 1 deletion Fluent.Ribbon.Showcase/Helpers/ThemeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public static string CreateAppStyleBy(Color color, bool changeImmediately = fals
// GalleryItem
resourceDictionary.Add("Fluent.Ribbon.Brushes.GalleryItem.MouseOver", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor20"]));
resourceDictionary.Add("Fluent.Ribbon.Brushes.GalleryItem.Selected", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor40"]));
resourceDictionary.Add("Fluent.Ribbon.Brushes.GalleryItem.Pressed", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor60"]));
resourceDictionary.Add("Fluent.Ribbon.Brushes.GalleryItem.Pressed", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor60"]));

// WindowCommands
resourceDictionary.Add("FFluent.Ribbon.Brushes.WindowCommands.CaptionButton.MouseOver.Background", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor20"]));
resourceDictionary.Add("Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Pressed.Background", GetSolidColorBrush((Color)resourceDictionary["Fluent.Ribbon.Colors.AccentColor40"]));

// Create theme
var resDictName = $"ApplicationAccent_{color.ToString().Replace("#", string.Empty)}.xaml";
Expand Down
Binary file removed Fluent.Ribbon.Showcase/Images/BlackTheme.png
Binary file not shown.
Binary file removed Fluent.Ribbon.Showcase/Images/BlueTheme.png
Binary file not shown.
Binary file removed Fluent.Ribbon.Showcase/Images/SilverTheme.png
Binary file not shown.
69 changes: 69 additions & 0 deletions Fluent.Ribbon.Showcase/RibbonWindowColorized.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<fluent:RibbonWindow x:Class="FluentTest.RibbonWindowColorized"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FluentTest"
xmlns:fluent="urn:fluent-ribbon"
mc:Ignorable="d"
Title="RibbonWindowColorized"
Height="600"
Width="800"
TitleForeground="White"
TitleBackground="Transparent">
<fluent:RibbonWindow.Resources>
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Background" Color="LightBlue" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Foreground" Color="Black" />

<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Background" Color="LightGreen" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground" Color="Black" />

<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.TabsGrid.Background" Color="LightCyan" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.TabsGrid.Foreground" Color="Black" />

<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Foreground" Color="White" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Background" Color="DarkSlateGray" />

<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.MouseOver.Background" Color="Green" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Pressed.Background" Color="DarkGray" />

<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CloseButton.MouseOver.Background" Color="Blue" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CloseButton.Pressed.Background" Color="DarkBlue" />
</fluent:RibbonWindow.Resources>

<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">
<TextBlock TextWrapping="Wrap"
Margin="5">
This sample shows how to use custom colors for various parts of the RibbonWindow, Ribbon, RibbonTitleBar and caption buttons inside WindowCommands.
<LineBreak />
The colors are chosen to be extreme by purpose.
<LineBreak />
Have a look at ColorizedRibbonWindow.xaml for details.
</TextBlock>
</Grid>
</Grid>
</fluent:RibbonWindow>
10 changes: 10 additions & 0 deletions Fluent.Ribbon.Showcase/RibbonWindowColorized.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FluentTest
{
public partial class RibbonWindowColorized
{
public RibbonWindowColorized()
{
this.InitializeComponent();
}
}
}
71 changes: 71 additions & 0 deletions Fluent.Ribbon.Showcase/RibbonWindowWithBackgroundImage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FluentTest"
xmlns:fluent="urn:fluent-ribbon"
xmlns:converters="clr-namespace:FluentTest.Converters"
mc:Ignorable="d"
Title="RibbonWindowWithBackgroundImage"
Height="600"
Width="800"
TitleForeground="Black"
TitleBackground="Transparent">
<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 WhiteColor}" />
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground" Color="Black" />
</fluent:RibbonWindow.Resources>

<Window.Background>
<ImageBrush ImageSource="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/banner.png"
Stretch="Fill"
Viewport="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Window}, Converter={StaticResource BackgroundImageViewportConverter}}"
ViewportUnits="Absolute"
TileMode="None"
AlignmentX="Right"
AlignmentY="Top" />
</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 Background="{DynamicResource WhiteBrush}"
Grid.Row="1">
<TextBlock TextWrapping="Wrap"
Margin="5">
This sample shows how to use custom colors for various parts of the RibbonWindow, Ribbon, RibbonTitleBar and caption buttons inside WindowCommands.
<LineBreak />
The colors are chosen to be extreme by purpose.
<LineBreak />
Have a look at ColorizedRibbonWindow.xaml for details.
</TextBlock>
</Grid>
</Grid>
</fluent:RibbonWindow>
10 changes: 10 additions & 0 deletions Fluent.Ribbon.Showcase/RibbonWindowWithBackgroundImage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FluentTest
{
public partial class RibbonWindowWithBackgroundImage
{
public RibbonWindowWithBackgroundImage()
{
this.InitializeComponent();
}
}
}
9 changes: 9 additions & 0 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3083,6 +3083,15 @@
<Fluent:Button x:Name="OpenModalRibbonWindow"
Size="Middle"
Click="OpenModalRibbonWindow_OnClick">Open Ribbon-Window (ShowDialog)</Fluent:Button>
<Fluent:Button x:Name="OpenRibbonWindowOnNewThread"
Size="Middle"
Click="OpenRibbonWindowOnNewThread_OnClick">Open Ribbon-Window (new Thread)</Fluent:Button>
<Fluent:Button x:Name="OpenRibbonWindowColorized"
Size="Middle"
Click="OpenRibbonWindowColorized_OnClick">Open Ribbon-Window (colorized)</Fluent:Button>
<Fluent:Button x:Name="OpenRibbonWindowWithBackgroundImage"
Size="Middle"
Click="OpenRibbonWindowWithBackgroundImage_OnClick">Open Ribbon-Window (with background image)</Fluent:Button>
</WrapPanel>
</GroupBox>
<GroupBox Header="Issue repros">
Expand Down
Loading

0 comments on commit fb3bfd4

Please sign in to comment.