Skip to content

Commit

Permalink
Adding test content to reproduce #173
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Sep 30, 2015
1 parent 2b42720 commit 7ba3e1e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
5 changes: 3 additions & 2 deletions FluentTest/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1212,9 +1212,10 @@
Header="Pink" />
</Fluent:DropDownButton>

<Fluent:Button Header="TEST"
<Fluent:Button Header="Refresh (Galleries)"
Icon="Images\Green.png"
LargeIcon="Images\GreenLarge.png"/>
LargeIcon="Images\GreenLarge.png"
Command="{Binding GalleryViewModel.RefreshCommand}" />

<!--Though, you may set children of the Gallery explicitly -->
<Fluent:DropDownButton Header="Pink"
Expand Down
41 changes: 25 additions & 16 deletions FluentTest/ViewModels/GalleryViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
namespace FluentTest.ViewModels
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Input;
using FluentTest.Commanding;

public class GalleryViewModel : ViewModel
{
private ObservableCollection<GalleryItemViewModel> items;

public GalleryViewModel()
{
this.Items = new ObservableCollection<GalleryItemViewModel>
{
new GalleryItemViewModel("Group 1", "1"),
new GalleryItemViewModel("Group 1", "2"),
new GalleryItemViewModel("Group 1", "3"),
new GalleryItemViewModel("Group 1", "4"),
new GalleryItemViewModel("Group 1", "5"),
new GalleryItemViewModel("Group 1", "6"),
this.Items = new ObservableCollection<GalleryItemViewModel>();
this.RefreshCommand = new RelayCommand(this.Refresh);

new GalleryItemViewModel("Group 2", "10"),
new GalleryItemViewModel("Group 2", "20"),
new GalleryItemViewModel("Group 2", "30"),
new GalleryItemViewModel("Group 2", "40"),
new GalleryItemViewModel("Group 2", "50"),
new GalleryItemViewModel("Group 2", "60"),
};
this.Refresh();
}

public ObservableCollection<GalleryItemViewModel> Items
Expand All @@ -37,5 +26,25 @@ private set
this.OnPropertyChanged("Items");
}
}

public ICommand RefreshCommand { get; private set; }

public void Refresh()
{
this.Items.Clear();

this.Items.Add(new GalleryItemViewModel("Group 1", "1"));
this.Items.Add(new GalleryItemViewModel("Group 1", "2"));
this.Items.Add(new GalleryItemViewModel("Group 1", "3"));
this.Items.Add(new GalleryItemViewModel("Group 1", "4"));
this.Items.Add(new GalleryItemViewModel("Group 1", "5"));
this.Items.Add(new GalleryItemViewModel("Group 1", "6"));
this.Items.Add(new GalleryItemViewModel("Group 2", "10"));
this.Items.Add(new GalleryItemViewModel("Group 2", "20"));
this.Items.Add(new GalleryItemViewModel("Group 2", "30"));
this.Items.Add(new GalleryItemViewModel("Group 2", "40"));
this.Items.Add(new GalleryItemViewModel("Group 2", "50"));
this.Items.Add(new GalleryItemViewModel("Group 2", "60"));
}
}
}

0 comments on commit 7ba3e1e

Please sign in to comment.