Skip to content

Commit

Permalink
Adding test for #256 to showcase application
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Feb 5, 2016
1 parent 750a9eb commit fafcd35
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
8 changes: 6 additions & 2 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,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 +513,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 +526,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
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

0 comments on commit fafcd35

Please sign in to comment.