Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keytip refactoring #264

Merged
merged 19 commits into from
Feb 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
- [#246](../../issues/246) - Bind RibbonGroupBox.DataContext on QuickAccessToolBar
- [#251](../../issues/251) - Changing RibbonStatusBar height to 23 and RibbonStatusBarItem foreground to BackstageFontBrush
- [#254](../../issues/254) - Basic fix for KeyTips not working when focus is inside a WinForms control
- [#256](../../issues/256) - ComboBox items don't update properly on ItemsSource binding source collection changes
- [#257](../../issues/257) - Windows8 RibbonWindowTitleTextGlowBackground was missing
- [#263](../../issues/263) - Changing theme from backstage is broken
- OpenBackstage command was not acting on the correct backstage in a multiple backstage scenario (thanks to @maurosampietro)

- ### Enhancements
Expand All @@ -48,6 +51,7 @@
- [#207](../../issues/207) - Enable DragMove on unused RibbonTabControl space like in Office 2013
- [#230](../../issues/230) - Option to disable the "Minimize"-Ribbon Button & Behavior
- [#242](../../issues/242) - Add start screen like in office 2013 and upwards
- [#258](../../issues/258) - Refactoring of KeyTipService and KeyTipAdorner

## 3.6.1

Expand Down
64 changes: 50 additions & 14 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,47 @@
</Fluent:BackstageTabItem.ContentTemplate>
</Fluent:BackstageTabItem>

<Fluent:BackstageTabItem Header="Change theme with fluent controls"
Content="Hello">
<Fluent:BackstageTabItem.ContentTemplate>
<DataTemplate>
<StackPanel>
<Fluent:Button Background="Blue"
Foreground="Black"
Click="OnOffice2010SilverClick">Office 2010 Silver</Fluent:Button>
<Fluent:Button Background="Blue"
Foreground="Black"
Click="OnOffice2010BlackClick">Office 2010 Black</Fluent:Button>
<Fluent:Button Background="Blue"
Foreground="Black"
Click="OnOffice2010BlueClick">Office 2010 Blue</Fluent:Button>
<Fluent:Button Background="Blue"
Foreground="Black"
Click="OnOffice2013Click">Office 2013 White</Fluent:Button>
<Fluent:Button Background="Blue"
Foreground="Black"
Click="OnWindows8Click">Windows8 White</Fluent:Button>
</StackPanel>
</DataTemplate>
</Fluent:BackstageTabItem.ContentTemplate>
</Fluent:BackstageTabItem>

<Fluent:BackstageTabItem Header="Change theme with standard controls"
Content="Hello">
<Fluent:BackstageTabItem.ContentTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:BackstageTabControl}}, Path=ParentBackstage.ActualHeight}" />
<Button Click="OnOffice2010SilverClick">Office 2010 Silver</Button>
<Button Click="OnOffice2010BlackClick">Office 2010 Black</Button>
<Button Click="OnOffice2010BlueClick">Office 2010 Blue</Button>
<Button Click="OnOffice2013Click">Office 2013 White</Button>
<Button Click="OnWindows8Click">Windows8 White</Button>
</StackPanel>
</DataTemplate>
</Fluent:BackstageTabItem.ContentTemplate>
</Fluent:BackstageTabItem>

<Fluent:SeparatorTabItem Header="Separator" />

<Fluent:BackstageTabItem Header="Info"
Expand Down Expand Up @@ -199,6 +240,7 @@
</Fluent:BackstageTabItem>

<Fluent:SeparatorTabItem />

<Fluent:BackstageTabItem Header="New"
KeyTip="N">
<Grid Margin="50"
Expand Down Expand Up @@ -242,12 +284,14 @@
ValueChanged="OnSpinnerValueChanged" />
</Grid>
</Fluent:BackstageTabItem>

<Fluent:BackstageTabItem Header="Print"
KeyTip="P">
<Grid Background="Yellow"
Opacity="0.3"
Margin="50" />
</Fluent:BackstageTabItem>

<Fluent:Button Header="Exit"
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Exit.png"
KeyTip="X"
Expand Down Expand Up @@ -378,8 +422,6 @@
IsChecked="True" />
<Fluent:QuickAccessMenuItem IsChecked="True"
Target="{Binding ElementName=UndoButton}" />
<Fluent:QuickAccessMenuItem IsChecked="True"
Target="{Binding ElementName=RedoButton}" />
</Fluent:Ribbon.QuickAccessItems>

<Fluent:RibbonTabItem x:Name="homeTabItem"
Expand Down Expand Up @@ -503,7 +545,7 @@
x:Name="groupLL">
<Fluent:ComboBox IsEditable="False"
InputWidth="150"
Header="Test"
Header="Fonts"
ItemsSource="{Binding FontsViewModel.FontsData}"
KeyTip="FD">
<Fluent:ComboBox.ItemTemplate>
Expand All @@ -513,9 +555,10 @@
</DataTemplate>
</Fluent:ComboBox.ItemTemplate>
</Fluent:ComboBox>

<Fluent:ComboBox IsEditable="False"
InputWidth="150"
Header="Test"
Header="Fonts"
ItemsSource="{Binding FontsViewModel.FontsData}">
<Fluent:ComboBox.ItemTemplate>
<DataTemplate>
Expand All @@ -525,6 +568,9 @@
</Fluent:ComboBox.ItemTemplate>
</Fluent:ComboBox>

<Fluent:Button Header="Add item to fonts"
Click="HandleAddItemToFontsClick" />

<Fluent:ComboBox Name="FilterComboBox"
IsReadOnly="True"
KeyTip="H"
Expand Down Expand Up @@ -974,16 +1020,6 @@
<Fluent:MenuItem Header="Undo something" />
<Fluent:MenuItem Header="Undo another thing" />
</Fluent:SplitButton>

<Fluent:SplitButton x:Name="RedoButton"
KeyTip="Ctrl+Y"
Header="Redo"
Icon="{DynamicResource appbar_redo}"
SizeDefinition="Middle,Small"
Command="ApplicationCommands.Redo"
CanAddButtonToQuickAccessToolBar="True"
FocusManager.IsFocusScope="True">
</Fluent:SplitButton>
</StackPanel>
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>
Expand Down
19 changes: 12 additions & 7 deletions Fluent.Ribbon.Showcase/TestContent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ private void OnLauncherButtonClick(object sender, RoutedEventArgs e)
var groupBox = (RibbonGroupBox)sender;

var wnd = new Window
{
Content = string.Format("Launcher-Window for: {0}", groupBox.Header),
Owner = Window.GetWindow(this)
};
{
Content = string.Format("Launcher-Window for: {0}", groupBox.Header),
Owner = Window.GetWindow(this)
};

wnd.Show();
}
Expand Down Expand Up @@ -338,9 +338,9 @@ private void OnSpinnerValueChanged(object sender, RoutedPropertyChangedEventArgs
private void OnMenuItemClick(object sender, RoutedEventArgs e)
{
var wnd = new TestWindow
{
Owner = Window.GetWindow(this)
};
{
Owner = Window.GetWindow(this)
};
wnd.Show();
}

Expand Down Expand Up @@ -427,6 +427,11 @@ private void ShowStartScreen_OnClick(object sender, RoutedEventArgs e)
this.startScreen.Shown = false;
this.startScreen.IsOpen = true;
}

private void HandleAddItemToFontsClick(object sender, RoutedEventArgs e)
{
this.viewModel.FontsViewModel.FontsData.Add($"Added item {this.viewModel.FontsViewModel.FontsData.Count}");
}
}

public class TestRoutedCommand
Expand Down
8 changes: 5 additions & 3 deletions Fluent.Ribbon.Showcase/ViewModels/FontsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
namespace FluentTest.ViewModels
using System.Collections.ObjectModel;

namespace FluentTest.ViewModels
{
public class FontsViewModel : ViewModel
{
private readonly string[] data = { "Tahoma", "Segoe UI", "Arial", "Courier New", "Symbol" };
private readonly ObservableCollection<string> data = new ObservableCollection<string> { "Tahoma", "Segoe UI", "Arial", "Courier New", "Symbol" };

public string[] FontsData
public ObservableCollection<string> FontsData
{
get { return this.data; }
}
Expand Down
Loading