├── .gitignore
├── FirstFloor.ModernUI
├── Binaries
│ └── Microsoft.Windows.Shell.dll
├── FirstFloor.ModernUI.App
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── ModernUI.BingImage.xaml
│ │ ├── ModernUI.HelloKitty.xaml
│ │ ├── ModernUI.Love.xaml
│ │ ├── ModernUI.Snowflakes.xaml
│ │ ├── appbar.add.xaml
│ │ ├── appbar.adobe.bridge.xaml
│ │ ├── appbar.arrow.collapsed.xaml
│ │ ├── appbar.arrow.corner.up.right.xaml
│ │ ├── appbar.arrow.down.xaml
│ │ ├── appbar.arrow.expand.xaml
│ │ ├── appbar.box.xaml
│ │ ├── appbar.camera.flash.off.xaml
│ │ ├── appbar.camera.flash.xaml
│ │ ├── appbar.camera.xaml
│ │ ├── appbar.cards.club.xaml
│ │ ├── appbar.cards.diamond.xaml
│ │ ├── appbar.cards.heart.xaml
│ │ ├── appbar.cards.spade.xaml
│ │ ├── appbar.check.xaml
│ │ ├── background.kitty.png
│ │ ├── background.love.jpg
│ │ └── background.snowflakes.jpg
│ ├── BingImage.cs
│ ├── Content
│ │ ├── ContentLoaderImages.xaml
│ │ ├── ContentLoaderImages.xaml.cs
│ │ ├── ContentLoaderIntro.xaml
│ │ ├── ContentLoaderIntro.xaml.cs
│ │ ├── ControlsModernBBCodeBlock.xaml
│ │ ├── ControlsModernBBCodeBlock.xaml.cs
│ │ ├── ControlsModernButton.xaml
│ │ ├── ControlsModernButton.xaml.cs
│ │ ├── ControlsModernDialog.xaml
│ │ ├── ControlsModernDialog.xaml.cs
│ │ ├── ControlsModernFrame.xaml
│ │ ├── ControlsModernFrame.xaml.cs
│ │ ├── ControlsModernMenu.xaml
│ │ ├── ControlsModernMenu.xaml.cs
│ │ ├── ControlsModernWindow.xaml
│ │ ├── ControlsModernWindow.xaml.cs
│ │ ├── ControlsStylesButton.xaml
│ │ ├── ControlsStylesButton.xaml.cs
│ │ ├── ControlsStylesDataGrid.xaml
│ │ ├── ControlsStylesDataGrid.xaml.cs
│ │ ├── ControlsStylesItemsControl.xaml
│ │ ├── ControlsStylesItemsControl.xaml.cs
│ │ ├── ControlsStylesProgressBar.xaml
│ │ ├── ControlsStylesProgressBar.xaml.cs
│ │ ├── ControlsStylesSampleForm.xaml
│ │ ├── ControlsStylesSampleForm.xaml.cs
│ │ ├── ControlsStylesSlider.xaml
│ │ ├── ControlsStylesSlider.xaml.cs
│ │ ├── ControlsStylesText.xaml
│ │ ├── ControlsStylesText.xaml.cs
│ │ ├── LoremIpsum.xaml
│ │ ├── LoremIpsum.xaml.cs
│ │ ├── LoremIpsumList.xaml
│ │ ├── LoremIpsumList.xaml.cs
│ │ ├── LoremIpsumSplit.xaml
│ │ ├── LoremIpsumSplit.xaml.cs
│ │ ├── ModernFrame
│ │ │ ├── CancelNavigateSample.xaml
│ │ │ ├── CancelNavigateSample.xaml.cs
│ │ │ ├── ErrorSample.xaml
│ │ │ ├── ErrorSample.xaml.cs
│ │ │ ├── Sample.xaml
│ │ │ └── Sample.xaml.cs
│ │ ├── SettingsAppearance.xaml
│ │ ├── SettingsAppearance.xaml.cs
│ │ └── SettingsAppearanceViewModel.cs
│ ├── FirstFloor.ModernUI.App.csproj
│ ├── FlickrImageLoader.cs
│ ├── LoremIpsumLoader.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Pages
│ │ ├── ContentLoader.xaml
│ │ ├── ContentLoader.xaml.cs
│ │ ├── ControlsModern.xaml
│ │ ├── ControlsModern.xaml.cs
│ │ ├── ControlsStyles.xaml
│ │ ├── ControlsStyles.xaml.cs
│ │ ├── Introduction.xaml
│ │ ├── Introduction.xaml.cs
│ │ ├── LayoutBasic.xaml
│ │ ├── LayoutBasic.xaml.cs
│ │ ├── LayoutList.xaml
│ │ ├── LayoutList.xaml.cs
│ │ ├── LayoutSplit.xaml
│ │ ├── LayoutSplit.xaml.cs
│ │ ├── LayoutTab.xaml
│ │ ├── LayoutTab.xaml.cs
│ │ ├── LayoutWireframe.xaml
│ │ ├── LayoutWireframe.xaml.cs
│ │ ├── Navigation.xaml
│ │ ├── Navigation.xaml.cs
│ │ ├── Settings.xaml
│ │ └── Settings.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── SampleDisabledCommand.cs
│ ├── SampleFormViewModel.cs
│ ├── SampleMsgBoxCommand.cs
│ └── SampleParameterCommand.cs
├── FirstFloor.ModernUI.sln
├── FirstFloor.ModernUI
│ ├── Assets
│ │ ├── Button.xaml
│ │ ├── Calendar.xaml
│ │ ├── CheckBox.xaml
│ │ ├── ComboBox.xaml
│ │ ├── ContextMenu.xaml
│ │ ├── Converters.xaml
│ │ ├── DataGrid.xaml
│ │ ├── DatePicker.xaml
│ │ ├── GridSplitter.xaml
│ │ ├── Hyperlink.xaml
│ │ ├── Label.xaml
│ │ ├── ListBox.xaml
│ │ ├── ListView.xaml
│ │ ├── MenuItem.xaml
│ │ ├── ModernUI.Dark.xaml
│ │ ├── ModernUI.Light.xaml
│ │ ├── ModernUI.xaml
│ │ ├── ModernWindowEx.xaml
│ │ ├── PasswordBox.xaml
│ │ ├── ProgressBar.xaml
│ │ ├── RadioButton.xaml
│ │ ├── ScrollBar.xaml
│ │ ├── Slider.xaml
│ │ ├── TextBlock.xaml
│ │ ├── TextBox.xaml
│ │ ├── ToolTip.xaml
│ │ └── TreeView.xaml
│ ├── FirstFloor.ModernUI.csproj
│ ├── ModernUIHelper.cs
│ ├── Presentation
│ │ ├── AppearanceManager.cs
│ │ ├── CommandBase.cs
│ │ ├── Displayable.cs
│ │ ├── FontSize.cs
│ │ ├── Link.cs
│ │ ├── LinkCollection.cs
│ │ ├── LinkGroup.cs
│ │ ├── LinkGroupCollection.cs
│ │ ├── NotifyPropertyChanged.cs
│ │ ├── ReadOnlyLinkGroupCollection.cs
│ │ └── RelayCommand.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Themes
│ │ ├── BBCodeBlock.xaml
│ │ ├── Generic.xaml
│ │ ├── ModernButton.xaml
│ │ ├── ModernDialog.xaml
│ │ ├── ModernFrame.xaml
│ │ ├── ModernMenu.xaml
│ │ ├── ModernTab.xaml
│ │ ├── ModernWindow.xaml
│ │ └── TransitioningContentControl.xaml
│ └── Windows
│ │ ├── CommandDictionary.cs
│ │ ├── Controls
│ │ ├── BBCode
│ │ │ ├── BBCodeLexer.cs
│ │ │ ├── BBCodeParser.cs
│ │ │ ├── CharBuffer.cs
│ │ │ ├── Lexer.cs
│ │ │ ├── ParseException.cs
│ │ │ ├── Parser.cs
│ │ │ ├── Token.cs
│ │ │ └── TokenBuffer.cs
│ │ ├── BBCodeBlock.cs
│ │ ├── DataGridCheckBoxColumn.cs
│ │ ├── DataGridComboBoxColumn.cs
│ │ ├── DataGridTextColumn.cs
│ │ ├── ModernButton.cs
│ │ ├── ModernDialog.cs
│ │ ├── ModernFrame.cs
│ │ ├── ModernMenu.cs
│ │ ├── ModernTab.cs
│ │ ├── ModernWindow.cs
│ │ ├── RelativeAnimatingContentControl.cs
│ │ ├── SourceEventArgs.cs
│ │ ├── TabLayout.cs
│ │ └── TransitioningContentControl.cs
│ │ ├── Converters
│ │ ├── BooleanToFontWeightConverter.cs
│ │ ├── BooleanToVisibilityConverter.cs
│ │ ├── NullOrEmptyStringToVisibilityConverter.cs
│ │ ├── NullToVisibilityConverter.cs
│ │ ├── ToLowerConverter.cs
│ │ └── ToUpperConverter.cs
│ │ ├── DefaultContentLoader.cs
│ │ ├── IContent.cs
│ │ ├── IContentLoader.cs
│ │ ├── Media
│ │ └── VisualTreeHelperEx.cs
│ │ └── Navigation
│ │ ├── DefaultLinkNavigator.cs
│ │ ├── FragmentNavigationEventArgs.cs
│ │ ├── ILinkNavigator.cs
│ │ ├── NavigatingCancelEventArgs.cs
│ │ ├── NavigationBaseEventArgs.cs
│ │ ├── NavigationEventArgs.cs
│ │ ├── NavigationFailedEventArgs.cs
│ │ ├── NavigationHelper.cs
│ │ └── NavigationType.cs
├── License.RelativeAnimatingContentControl.txt
├── License.icons.txt
└── License.txt
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Windows Store app package directory
89 | AppPackages/
90 |
91 | # Others
92 | [Bb]in
93 | [Oo]bj
94 | sql
95 | TestResults
96 | [Tt]est[Rr]esult*
97 | *.Cache
98 | ClientBin
99 | [Ss]tyle[Cc]op.*
100 | ~$*
101 | *.dbmdl
102 | Generated_Code #added for RIA/Silverlight projects
103 |
104 | # Backup & report files from converting an old project file to a newer
105 | # Visual Studio version. Backup files are not needed, because we have git ;-)
106 | _UpgradeReport_Files/
107 | Backup*/
108 | UpgradeLog*.XML
109 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/Binaries/Microsoft.Windows.Shell.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaedei/ModernUIforWPF/2503fc7d1f7feb53b41b110eaf786ce8824acc60/FirstFloor.ModernUI/Binaries/Microsoft.Windows.Shell.dll
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using FirstFloor.ModernUI.Windows.Controls;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Configuration;
6 | using System.Data;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace FirstFloor.ModernUI.App
12 | {
13 | ///
14 | /// Interaction logic for App.xaml
15 | ///
16 | public partial class App : Application
17 | {
18 | ///
19 | /// Raises the event.
20 | ///
21 | /// A that contains the event data.
22 | protected override void OnStartup(StartupEventArgs e)
23 | {
24 | base.OnStartup(e);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/ModernUI.BingImage.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/ModernUI.HelloKitty.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 | #f472d0
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/ModernUI.Love.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 | #e51400
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/ModernUI.Snowflakes.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 | #0082AD
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.add.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.adobe.bridge.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.arrow.collapsed.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.arrow.corner.up.right.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.arrow.down.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.arrow.expand.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.box.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.camera.flash.off.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.camera.flash.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.camera.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.cards.club.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.cards.diamond.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.cards.heart.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.cards.spade.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/appbar.check.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.kitty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaedei/ModernUIforWPF/2503fc7d1f7feb53b41b110eaf786ce8824acc60/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.kitty.png
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.love.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaedei/ModernUIforWPF/2503fc7d1f7feb53b41b110eaf786ce8824acc60/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.love.jpg
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.snowflakes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kaedei/ModernUIforWPF/2503fc7d1f7feb53b41b110eaf786ce8824acc60/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Assets/background.snowflakes.jpg
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/BingImage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Net.Http;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Xml.Linq;
13 | using System.Xml.XPath;
14 |
15 | namespace FirstFloor.ModernUI.App
16 | {
17 | ///
18 | /// Provides an attached property determining the current Bing image and assigning it to an image or imagebrush.
19 | ///
20 | public static class BingImage
21 | {
22 | public static readonly DependencyProperty UseBingImageProperty = DependencyProperty.RegisterAttached("UseBingImage", typeof(bool), typeof(BingImage), new PropertyMetadata(OnUseBingImageChanged));
23 |
24 | private static BitmapImage cachedBingImage;
25 |
26 | private static async void OnUseBingImageChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
27 | {
28 | var newValue = (bool)e.NewValue;
29 | var image = o as Image;
30 | var imageBrush = o as ImageBrush;
31 |
32 | if (!newValue || (image == null && imageBrush == null)) {
33 | return;
34 | }
35 |
36 | if (cachedBingImage == null) {
37 | var url = await GetCurrentBingImageUrl();
38 | if (url != null) {
39 | cachedBingImage = new BitmapImage(url);
40 | }
41 | }
42 |
43 | if (cachedBingImage != null){
44 | if (image != null) {
45 | image.Source = cachedBingImage;
46 | }
47 | else if (imageBrush != null) {
48 | imageBrush.ImageSource = cachedBingImage;
49 | }
50 | }
51 | }
52 |
53 | private static async Task GetCurrentBingImageUrl()
54 | {
55 | var client = new HttpClient();
56 | var result = await client.GetAsync("http://www.bing.com/hpimagearchive.aspx?format=xml&idx=0&n=2&mbl=1&mkt=en-ww");
57 | if (result.IsSuccessStatusCode) {
58 | using (var stream = await result.Content.ReadAsStreamAsync()) {
59 | var doc = XDocument.Load(stream);
60 |
61 | var url = (string)doc.XPathSelectElement("/images/image/url");
62 |
63 | return new Uri(string.Format(CultureInfo.InvariantCulture, "http://bing.com{0}", url), UriKind.Absolute);
64 | }
65 | }
66 |
67 | return null;
68 | }
69 |
70 |
71 | public static bool GetUseBingImage(DependencyObject o)
72 | {
73 | return (bool)o.GetValue(UseBingImageProperty);
74 | }
75 |
76 | public static void SetUseBingImage(DependencyObject o, bool value)
77 | {
78 | o.SetValue(UseBingImageProperty, value);
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ContentLoaderImages.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ContentLoaderImages.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ContentLoaderImages.xaml
20 | ///
21 | public partial class ContentLoaderImages : UserControl
22 | {
23 | public ContentLoaderImages()
24 | {
25 | InitializeComponent();
26 |
27 | LoadImageLinks();
28 | }
29 |
30 | private async void LoadImageLinks()
31 | {
32 | var loader = (FlickrImageLoader)Tab.ContentLoader;
33 |
34 | // load image links and assign to tab list
35 | this.Tab.Links = await loader.GetInterestingnessListAsync();
36 |
37 | // select first link
38 | this.Tab.SelectedSource = this.Tab.Links.Select(l => l.Source).FirstOrDefault();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ContentLoaderIntro.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ContentLoaderIntro.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ContentLoaderIntro.xaml
20 | ///
21 | public partial class ContentLoaderIntro : UserControl
22 | {
23 | public ContentLoaderIntro()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernBBCodeBlock.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernBBCodeBlock.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsModernBBCodeBlock.xaml
20 | ///
21 | public partial class ControlsModernBBCodeBlock : UserControl
22 | {
23 | public ControlsModernBBCodeBlock()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernButton.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernButton.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows.Controls;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 | using System.Xml.Linq;
17 |
18 | namespace FirstFloor.ModernUI.App.Content
19 | {
20 | ///
21 | /// Interaction logic for ControlsModernButton.xaml
22 | ///
23 | public partial class ControlsModernButton : UserControl
24 | {
25 | public ControlsModernButton()
26 | {
27 | InitializeComponent();
28 |
29 | // find all embedded XAML icon files
30 | var assembly = GetType().Assembly;
31 | var iconResourceNames = from name in assembly.GetManifestResourceNames()
32 | where name.StartsWith("FirstFloor.ModernUI.App.Assets.appbar.")
33 | select name;
34 |
35 |
36 | foreach (var name in iconResourceNames) {
37 | // load the resource stream
38 | using (var stream = assembly.GetManifestResourceStream(name)) {
39 | // parse the icon data using xml
40 | var doc = XDocument.Load(stream);
41 |
42 | var path = doc.Root.Element("{http://schemas.microsoft.com/winfx/2006/xaml/presentation}Path");
43 | if (path != null) {
44 | var data = (string)path.Attribute("Data");
45 |
46 | // create a modern button and add it to the button panel
47 | ButtonPanel.Children.Add(new ModernButton {
48 | IconData = PathGeometry.Parse(data),
49 | Margin = new Thickness(0, 0, 4, 8)
50 | });
51 | }
52 | }
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernDialog.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows.Controls;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Navigation;
16 | using System.Windows.Shapes;
17 |
18 | namespace FirstFloor.ModernUI.App.Content
19 | {
20 | ///
21 | /// Interaction logic for ControlsModernDialog.xaml
22 | ///
23 | public partial class ControlsModernDialog : UserControl
24 | {
25 | public ControlsModernDialog()
26 | {
27 | InitializeComponent();
28 | }
29 |
30 | private void CommonDialog_Click(object sender, RoutedEventArgs e)
31 | {
32 | new ModernDialog {
33 | Title = "Common dialog",
34 | Content = new LoremIpsum()
35 | }.ShowDialog();
36 | }
37 |
38 | private void MessageDialog_Click(object sender, RoutedEventArgs e)
39 | {
40 | var result = ModernDialog.ShowMessage("This is a simple Modern UI styled message dialog. Do you like it?", "Message Dialog", MessageBoxButton.YesNo);
41 |
42 | Debug.WriteLine("Dialog result: {0}", result);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernFrame.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows.Navigation;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace FirstFloor.ModernUI.App.Content
18 | {
19 | ///
20 | /// Interaction logic for ControlsModernFrame.xaml
21 | ///
22 | public partial class ControlsModernFrame : UserControl
23 | {
24 | private string eventLogMessage;
25 |
26 | public ControlsModernFrame()
27 | {
28 | InitializeComponent();
29 |
30 | this.TextEvents.Text = eventLogMessage;
31 | }
32 |
33 | private void LogMessage(string message, params object[] o)
34 | {
35 | message = string.Format(CultureInfo.CurrentUICulture, message, o);
36 |
37 | if (this.TextEvents == null) {
38 | this.eventLogMessage += message;
39 | }
40 | else {
41 | this.TextEvents.AppendText(message);
42 | }
43 | }
44 |
45 | private void Frame_FragmentNavigation(object sender, FragmentNavigationEventArgs e)
46 | {
47 | LogMessage("FragmentNavigation: {0}\r\n", e.Fragment);
48 | }
49 |
50 | private void Frame_Navigated(object sender, NavigationEventArgs e)
51 | {
52 | LogMessage("Navigated: [{0}] {1}\r\n", e.NavigationType, e.Source);
53 | }
54 |
55 | private void Frame_Navigating(object sender, NavigatingCancelEventArgs e)
56 | {
57 | LogMessage("Navigating: [{0}] {1}\r\n", e.NavigationType, e.Source);
58 | }
59 |
60 | private void Frame_NavigationFailed(object sender, NavigationFailedEventArgs e)
61 | {
62 | LogMessage("NavigationFailed: {0}\r\n", e.Error.Message);
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernMenu.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernMenu.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Globalization;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Navigation;
16 | using System.Windows.Shapes;
17 |
18 | namespace FirstFloor.ModernUI.App.Content
19 | {
20 | ///
21 | /// Interaction logic for ControlsModernMenu.xaml
22 | ///
23 | public partial class ControlsModernMenu : UserControl
24 | {
25 | private int groupId = 2;
26 | private int linkId = 5;
27 |
28 | public ControlsModernMenu()
29 | {
30 | InitializeComponent();
31 |
32 | // add group command
33 | this.AddGroup.Command = new RelayCommand(o => {
34 | this.Menu.LinkGroups.Add(new LinkGroup {
35 | DisplayName = string.Format(CultureInfo.InvariantCulture, "group {0}",
36 | ++groupId)
37 | });
38 | });
39 |
40 | // add link to selected group command
41 | this.AddLink.Command = new RelayCommand(o => {
42 | this.Menu.SelectedLinkGroup.Links.Add(new Link {
43 | DisplayName = string.Format(CultureInfo.InvariantCulture, "link {0}", ++linkId),
44 | Source = new Uri(string.Format(CultureInfo.InvariantCulture, "/link{0}", linkId), UriKind.Relative)
45 | });
46 | }, o => this.Menu.SelectedLinkGroup != null);
47 |
48 | // remove selected group command
49 | this.RemoveGroup.Command = new RelayCommand(o => {
50 | this.Menu.LinkGroups.Remove(this.Menu.SelectedLinkGroup);
51 | }, o => this.Menu.SelectedLinkGroup != null);
52 |
53 | // remove selected linkcommand
54 | this.RemoveLink.Command = new RelayCommand(o => {
55 | this.Menu.SelectedLinkGroup.Links.Remove(this.Menu.SelectedLink);
56 | }, o => this.Menu.SelectedLinkGroup != null && this.Menu.SelectedLink != null);
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsModernWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows.Controls;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace FirstFloor.ModernUI.App.Content
18 | {
19 | ///
20 | /// Interaction logic for ControlsModernWindow.xaml
21 | ///
22 | public partial class ControlsModernWindow : UserControl
23 | {
24 | public ControlsModernWindow()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | private void EmptyWindow_Click(object sender, RoutedEventArgs e)
30 | {
31 | // create an empty modern window with lorem content
32 | // the EmptyWindow ModernWindow styles is found in the mui assembly at Assets/ModernWindowEx.xaml
33 |
34 | var wnd = new ModernWindow {
35 | Style = (Style)App.Current.Resources["EmptyWindow"],
36 | Content = new LoremIpsum {
37 | Margin = new Thickness(32)
38 | },
39 | Width = 480,
40 | Height = 480
41 | };
42 |
43 | wnd.Show();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesButton.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesButton.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesButton.xaml
20 | ///
21 | public partial class ControlsStylesButton : UserControl
22 | {
23 | public ControlsStylesButton()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesDataGrid.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesItemsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesItemsControl.xaml
20 | ///
21 | public partial class ControlsStylesItemsControl : UserControl
22 | {
23 | public ControlsStylesItemsControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesProgressBar.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesProgressBar.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesProgressBar.xaml
20 | ///
21 | public partial class ControlsStylesProgressBar : UserControl
22 | {
23 | public ControlsStylesProgressBar()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesSampleForm.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesSampleForm.xaml
20 | ///
21 | public partial class ControlsStylesSampleForm : UserControl
22 | {
23 | public ControlsStylesSampleForm()
24 | {
25 | InitializeComponent();
26 |
27 | this.Loaded += OnLoaded;
28 | }
29 |
30 | void OnLoaded(object sender, RoutedEventArgs e)
31 | {
32 | // select first control on the form
33 | Keyboard.Focus(this.TextFirstName);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesSlider.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesSlider.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesSlider.xaml
20 | ///
21 | public partial class ControlsStylesSlider : UserControl
22 | {
23 | public ControlsStylesSlider()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesText.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ControlsStylesText.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for ControlsStylesText.xaml
20 | ///
21 | public partial class ControlsStylesText : UserControl
22 | {
23 | public ControlsStylesText()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsum.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsum.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for LoremIpsum.xaml
20 | ///
21 | public partial class LoremIpsum : UserControl
22 | {
23 | public LoremIpsum()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsumList.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsumList.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for LoremIpsumList.xaml
20 | ///
21 | public partial class LoremIpsumList : UserControl
22 | {
23 | public LoremIpsumList()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsumSplit.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/LoremIpsumSplit.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content
17 | {
18 | ///
19 | /// Interaction logic for LoremIpsumSplit.xaml
20 | ///
21 | public partial class LoremIpsumSplit : UserControl
22 | {
23 | public LoremIpsumSplit()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/CancelNavigateSample.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/CancelNavigateSample.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows;
2 | using FirstFloor.ModernUI.Windows.Controls;
3 | using FirstFloor.ModernUI.Windows.Navigation;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Globalization;
7 | using System.Linq;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows;
11 | using System.Windows.Controls;
12 | using System.Windows.Data;
13 | using System.Windows.Documents;
14 | using System.Windows.Input;
15 | using System.Windows.Media;
16 | using System.Windows.Media.Imaging;
17 | using System.Windows.Shapes;
18 |
19 | namespace FirstFloor.ModernUI.App.Content.ModernFrame
20 | {
21 | ///
22 | /// Interaction logic for CancelNavigateSample.xaml
23 | ///
24 | public partial class CancelNavigateSample : UserControl, IContent
25 | {
26 | public CancelNavigateSample()
27 | {
28 | InitializeComponent();
29 | }
30 |
31 | public void OnFragmentNavigation(FragmentNavigationEventArgs e)
32 | {
33 | // display the current navigated fragment
34 | fragmentNav.BBCode = string.Format(CultureInfo.CurrentUICulture, "Current navigation fragment: '[b]{0}[/b]'", e.Fragment);
35 | }
36 |
37 | public void OnNavigatedFrom(NavigationEventArgs e)
38 | {
39 | }
40 |
41 | public void OnNavigatedTo(NavigationEventArgs e)
42 | {
43 | // clear fragment text
44 | fragmentNav.BBCode = null;
45 | }
46 |
47 | public void OnNavigatingFrom(NavigatingCancelEventArgs e)
48 | {
49 | // ask user if navigating away is ok
50 | string frameDescription;
51 | if (e.IsParentFrameNavigating){
52 | frameDescription = "A parent frame";
53 | }
54 | else {
55 | frameDescription = "This frame";
56 | }
57 |
58 | // modern message dialog supports BBCode tags
59 | var question = string.Format(CultureInfo.CurrentUICulture, "[b]{0}[/b] is about to navigate to new content. Do you want to allow this?", frameDescription);
60 |
61 | if (false == ModernDialog.ShowMessage(question, "navigate", System.Windows.MessageBoxButton.YesNo)) {
62 | e.Cancel = true;
63 | }
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/ErrorSample.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/ErrorSample.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content.ModernFrame
17 | {
18 | ///
19 | /// Interaction logic for ErrorSample.xaml
20 | ///
21 | public partial class ErrorSample : UserControl
22 | {
23 | public ErrorSample()
24 | {
25 | InitializeComponent();
26 |
27 | // raise exception to create navigation failure
28 | throw new NotSupportedException();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/Sample.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/ModernFrame/Sample.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Content.ModernFrame
17 | {
18 | ///
19 | /// Interaction logic for Sample.xaml
20 | ///
21 | public partial class Sample : UserControl
22 | {
23 | public Sample()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/SettingsAppearance.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
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 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Content/SettingsAppearance.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace FirstFloor.ModernUI.App.Content
18 | {
19 | ///
20 | /// Interaction logic for SettingsAppearance.xaml
21 | ///
22 | public partial class SettingsAppearance : UserControl
23 | {
24 | public SettingsAppearance()
25 | {
26 | InitializeComponent();
27 |
28 | // a simple view model for appearance configuration
29 | this.DataContext = new SettingsAppearanceViewModel();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/LoremIpsumLoader.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.App.Content;
2 | using FirstFloor.ModernUI.Windows;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace FirstFloor.ModernUI.App
10 | {
11 | ///
12 | /// Loads lorem ipsum content regardless the given uri.
13 | ///
14 | public class LoremIpsumLoader
15 | : DefaultContentLoader
16 | {
17 | ///
18 | /// Loads the content from specified uri.
19 | ///
20 | /// The content uri
21 | /// The loaded content.
22 | protected override object LoadContent(Uri uri)
23 | {
24 | // return a new LoremIpsum user control instance no matter the uri
25 | return new LoremIpsum();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Windows.Controls;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : ModernWindow
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ContentLoader.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ContentLoader.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace FirstFloor.ModernUI.App.Pages
18 | {
19 | ///
20 | /// Interaction logic for ContentLoader.xaml
21 | ///
22 | public partial class ContentLoader : UserControl
23 | {
24 | public ContentLoader()
25 | {
26 | InitializeComponent();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ControlsModern.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ControlsModern.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for ControlsModern.xaml
20 | ///
21 | public partial class ControlsModern : UserControl
22 | {
23 | public ControlsModern()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ControlsStyles.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/ControlsStyles.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for ControlsStyles.xaml
20 | ///
21 | public partial class ControlsStyles : UserControl
22 | {
23 | public ControlsStyles()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/Introduction.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/Introduction.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for Introduction.xaml
20 | ///
21 | public partial class Introduction : UserControl
22 | {
23 | public Introduction()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutBasic.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutBasic.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for LayoutBasic.xaml
20 | ///
21 | public partial class LayoutBasic : UserControl
22 | {
23 | public LayoutBasic()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutList.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutList.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for LayoutList.xaml
20 | ///
21 | public partial class LayoutList : UserControl
22 | {
23 | public LayoutList()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutSplit.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutSplit.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for LayoutSplit.xaml
20 | ///
21 | public partial class LayoutSplit : UserControl
22 | {
23 | public LayoutSplit()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutTab.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutTab.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for LayoutTab.xaml
20 | ///
21 | public partial class LayoutTab : UserControl
22 | {
23 | public LayoutTab()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutWireframe.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
15 |
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 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/LayoutWireframe.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for LayoutWireframe.xaml
20 | ///
21 | public partial class LayoutWireframe : UserControl
22 | {
23 | public LayoutWireframe()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/Navigation.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for Navigation.xaml
20 | ///
21 | public partial class Navigation : UserControl
22 | {
23 | public Navigation()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/Settings.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Pages/Settings.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FirstFloor.ModernUI.App.Pages
17 | {
18 | ///
19 | /// Interaction logic for Settings.xaml
20 | ///
21 | public partial class Settings : UserControl
22 | {
23 | public Settings()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("FirstFloor.ModernUI.App")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("FirstFloor.ModernUI.App")]
15 | [assembly: AssemblyCopyright("Copyright © 2013")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17929
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FirstFloor.ModernUI.App.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FirstFloor.ModernUI.App.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.17929
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FirstFloor.ModernUI.App.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/SampleDisabledCommand.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FirstFloor.ModernUI.App
9 | {
10 | ///
11 | /// An ICommand implementation that cannot execute.
12 | ///
13 | public class SampleDisabledCommand
14 | : CommandBase
15 | {
16 | ///
17 | /// Defines the method that determines whether the command can execute in its current state.
18 | ///
19 | /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
20 | ///
21 | /// true if this command can be executed; otherwise, false.
22 | ///
23 | public override bool CanExecute(object parameter)
24 | {
25 | return false; // cannot execute
26 | }
27 |
28 | ///
29 | /// Executes the command.
30 | ///
31 | /// The parameter.
32 | protected override void OnExecute(object parameter)
33 | {
34 | throw new NotSupportedException();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/SampleFormViewModel.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace FirstFloor.ModernUI.App
10 | {
11 | public class SampleFormViewModel
12 | : NotifyPropertyChanged, IDataErrorInfo
13 | {
14 | private string firstName = "John";
15 | private string lastName;
16 |
17 | public string FirstName
18 | {
19 | get { return this.firstName; }
20 | set
21 | {
22 | if (this.firstName != value) {
23 | this.firstName = value;
24 | OnPropertyChanged("FirstName");
25 | }
26 | }
27 | }
28 |
29 | public string LastName
30 | {
31 | get { return this.lastName; }
32 | set
33 | {
34 | if (this.lastName != value) {
35 | this.lastName = value;
36 | OnPropertyChanged("LastName");
37 | }
38 | }
39 | }
40 |
41 | public string Error
42 | {
43 | get { return null; }
44 | }
45 |
46 | public string this[string columnName]
47 | {
48 | get
49 | {
50 | if (columnName == "FirstName") {
51 | return string.IsNullOrEmpty(this.firstName) ? "Required value" : null;
52 | }
53 | if (columnName == "LastName") {
54 | return string.IsNullOrEmpty(this.lastName) ? "Required value" : null;
55 | }
56 | return null;
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/SampleMsgBoxCommand.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using FirstFloor.ModernUI.Windows.Controls;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 |
10 | namespace FirstFloor.ModernUI.App
11 | {
12 | ///
13 | /// An ICommand implementation displaying a message box.
14 | ///
15 | public class SampleMsgBoxCommand
16 | : CommandBase
17 | {
18 | ///
19 | /// Executes the command.
20 | ///
21 | /// The parameter.
22 | protected override void OnExecute(object parameter)
23 | {
24 | ModernDialog.ShowMessage("A messagebox triggered by selecting a hyperlink", "Messagebox", MessageBoxButton.OK);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.App/SampleParameterCommand.cs:
--------------------------------------------------------------------------------
1 | using FirstFloor.ModernUI.Presentation;
2 | using FirstFloor.ModernUI.Windows.Controls;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Globalization;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 |
11 | namespace FirstFloor.ModernUI.App
12 | {
13 | ///
14 | /// An ICommand implementation that displays the provided command parameter in a message box.
15 | ///
16 | public class SampleParameterCommand
17 | : CommandBase
18 | {
19 | ///
20 | /// Executes the command.
21 | ///
22 | /// The parameter.
23 | protected override void OnExecute(object parameter)
24 | {
25 | ModernDialog.ShowMessage(string.Format(CultureInfo.CurrentUICulture, "Executing command, command parameter = '{0}'", parameter), "SampleCommand", MessageBoxButton.OK);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FirstFloor.ModernUI", "FirstFloor.ModernUI\FirstFloor.ModernUI.csproj", "{9A653A28-FE46-40E8-A14F-48B0E325165D}"
5 | EndProject
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Binaries", "Binaries", "{E3D8DFD4-4299-4FE0-9BE8-0CB41F189489}"
7 | ProjectSection(SolutionItems) = preProject
8 | Binaries\Microsoft.Windows.Shell.dll = Binaries\Microsoft.Windows.Shell.dll
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FirstFloor.ModernUI.App", "FirstFloor.ModernUI.App\FirstFloor.ModernUI.App.csproj", "{BA5911EB-F34B-4F8D-AB29-6B967ED0B8DC}"
12 | EndProject
13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "License", "License", "{2AC3CC94-8119-4CDC-A01C-02455F8E8AF5}"
14 | ProjectSection(SolutionItems) = preProject
15 | License.Icons.txt = License.Icons.txt
16 | License.RelativeAnimatingContentControl.txt = License.RelativeAnimatingContentControl.txt
17 | License.txt = License.txt
18 | EndProjectSection
19 | EndProject
20 | Global
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Release|Any CPU = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {9A653A28-FE46-40E8-A14F-48B0E325165D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27 | {9A653A28-FE46-40E8-A14F-48B0E325165D}.Debug|Any CPU.Build.0 = Debug|Any CPU
28 | {9A653A28-FE46-40E8-A14F-48B0E325165D}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {9A653A28-FE46-40E8-A14F-48B0E325165D}.Release|Any CPU.Build.0 = Release|Any CPU
30 | {BA5911EB-F34B-4F8D-AB29-6B967ED0B8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
31 | {BA5911EB-F34B-4F8D-AB29-6B967ED0B8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
32 | {BA5911EB-F34B-4F8D-AB29-6B967ED0B8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {BA5911EB-F34B-4F8D-AB29-6B967ED0B8DC}.Release|Any CPU.Build.0 = Release|Any CPU
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/ContextMenu.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
48 |
49 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/Converters.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/GridSplitter.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
16 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/Hyperlink.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
19 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/Label.xaml:
--------------------------------------------------------------------------------
1 |
3 |
31 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/ModernUI.xaml:
--------------------------------------------------------------------------------
1 |
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 | #1ba1e2
34 |
35 |
36 |
37 |
38 | Microsoft YaHei
39 | 13
40 |
41 | Consolas
42 | 13.333
43 |
44 | 11
45 |
46 |
47 | -36,-8,-16,-16
48 | 16,28,16,16
49 | -16,16,0,0
50 | 0,-28,44,0
51 |
52 | 0,0,0,0
53 | 16,0,0,0
54 |
55 |
56 |
59 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/PasswordBox.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
48 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/RadioButton.xaml:
--------------------------------------------------------------------------------
1 |
3 |
40 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/TextBlock.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
16 |
17 |
22 |
23 |
28 |
29 |
35 |
36 |
41 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Assets/ToolTip.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
39 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/ModernUIHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace FirstFloor.ModernUI
10 | {
11 | ///
12 | /// Provides various common helper methods.
13 | ///
14 | public static class ModernUIHelper
15 | {
16 | private static bool? isInDesignMode;
17 |
18 | ///
19 | /// Determines whether the current code is executed in a design time environment such as Visual Studio or Blend.
20 | ///
21 | public static bool IsInDesignMode
22 | {
23 | get
24 | {
25 | if (!isInDesignMode.HasValue) {
26 | isInDesignMode = DesignerProperties.GetIsInDesignMode(new DependencyObject());
27 | }
28 | return isInDesignMode.Value;
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/CommandBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace FirstFloor.ModernUI.Presentation
9 | {
10 | ///
11 | /// The base implementation of a command.
12 | ///
13 | public abstract class CommandBase
14 | : ICommand
15 | {
16 | ///
17 | /// Occurs when changes occur that affect whether or not the command should execute.
18 | ///
19 | public event EventHandler CanExecuteChanged
20 | {
21 | add { System.Windows.Input.CommandManager.RequerySuggested += value; }
22 | remove { System.Windows.Input.CommandManager.RequerySuggested -= value; }
23 | }
24 |
25 | ///
26 | /// Raises the event.
27 | ///
28 | public void OnCanExecuteChanged()
29 | {
30 | System.Windows.Input.CommandManager.InvalidateRequerySuggested();
31 | }
32 |
33 | ///
34 | /// Defines the method that determines whether the command can execute in its current state.
35 | ///
36 | /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
37 | ///
38 | /// true if this command can be executed; otherwise, false.
39 | ///
40 | public virtual bool CanExecute(object parameter)
41 | {
42 | return true;
43 | }
44 |
45 | ///
46 | /// Defines the method to be called when the command is invoked.
47 | ///
48 | /// Data used by the command. If the command does not require data to be passed, this object can be set to null.
49 | public void Execute(object parameter)
50 | {
51 | if (!CanExecute(parameter)) {
52 | return;
53 | }
54 | OnExecute(parameter);
55 | }
56 |
57 | ///
58 | /// Executes the command.
59 | ///
60 | /// The parameter.
61 | protected abstract void OnExecute(object parameter);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/Displayable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FirstFloor.ModernUI.Presentation
8 | {
9 | ///
10 | /// Provides a base implementation for objects that are displayed in the UI.
11 | ///
12 | public abstract class Displayable
13 | : NotifyPropertyChanged
14 | {
15 | private string displayName;
16 |
17 | ///
18 | /// Gets or sets the display name.
19 | ///
20 | /// The display name.
21 | public string DisplayName
22 | {
23 | get { return this.displayName; }
24 | set
25 | {
26 | if (this.displayName != value) {
27 | this.displayName = value;
28 | OnPropertyChanged("DisplayName");
29 | }
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/FontSize.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FirstFloor.ModernUI.Presentation
8 | {
9 | ///
10 | /// Identifies the available font size.
11 | ///
12 | public enum FontSize
13 | {
14 | ///
15 | /// Large fonts.
16 | ///
17 | Large,
18 | ///
19 | /// Small fonts.
20 | ///
21 | Small
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/Link.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FirstFloor.ModernUI.Presentation
8 | {
9 | ///
10 | /// Represents a displayable link.
11 | ///
12 | public class Link
13 | : Displayable
14 | {
15 | private Uri source;
16 |
17 | ///
18 | /// Gets or sets the source uri.
19 | ///
20 | /// The source.
21 | public Uri Source
22 | {
23 | get { return this.source; }
24 | set
25 | {
26 | if (this.source != value) {
27 | this.source = value;
28 | OnPropertyChanged("Source");
29 | }
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/LinkCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Input;
8 |
9 | namespace FirstFloor.ModernUI.Presentation
10 | {
11 | ///
12 | /// Represents an observable collection of links.
13 | ///
14 | public class LinkCollection
15 | : ObservableCollection
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | public LinkCollection()
21 | {
22 | }
23 |
24 | ///
25 | /// Initializes a new instance of the class that contains specified links.
26 | ///
27 | /// The links that are copied to this collection.
28 | public LinkCollection(IEnumerable links)
29 | {
30 | if (links == null) {
31 | throw new ArgumentNullException("links");
32 | }
33 | foreach (var link in links) {
34 | Add(link);
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/LinkGroup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FirstFloor.ModernUI.Presentation
8 | {
9 | ///
10 | /// Represents a named group of links.
11 | ///
12 | public class LinkGroup
13 | : Displayable
14 | {
15 | private string groupName;
16 | private Link selectedLink;
17 | private LinkCollection links = new LinkCollection();
18 |
19 | ///
20 | /// Gets or sets the name of the group.
21 | ///
22 | /// The name of the group.
23 | public string GroupName
24 | {
25 | get { return this.groupName; }
26 | set
27 | {
28 | if (this.groupName != value) {
29 | this.groupName = value;
30 | OnPropertyChanged("GroupName");
31 | }
32 | }
33 | }
34 |
35 | ///
36 | /// Gets or sets the selected link in this group.
37 | ///
38 | /// The selected link.
39 | internal Link SelectedLink
40 | {
41 | get { return this.selectedLink; }
42 | set
43 | {
44 | if (this.selectedLink != value) {
45 | this.selectedLink = value;
46 | OnPropertyChanged("SelectedLink");
47 | }
48 | }
49 | }
50 |
51 | ///
52 | /// Gets the links.
53 | ///
54 | /// The links.
55 | public LinkCollection Links
56 | {
57 | get { return this.links; }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/LinkGroupCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Input;
8 |
9 | namespace FirstFloor.ModernUI.Presentation
10 | {
11 | ///
12 | /// Represents an observable collection of link groups.
13 | ///
14 | public class LinkGroupCollection
15 | : ObservableCollection
16 | {
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/NotifyPropertyChanged.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FirstFloor.ModernUI.Presentation
9 | {
10 | ///
11 | /// The base implementation of the INotifyPropertyChanged contract.
12 | ///
13 | public abstract class NotifyPropertyChanged
14 | : INotifyPropertyChanged
15 | {
16 | ///
17 | /// Occurs when a property value changes.
18 | ///
19 | public event PropertyChangedEventHandler PropertyChanged;
20 |
21 | ///
22 | /// Raises the PropertyChanged event.
23 | ///
24 | /// Name of the property.
25 | protected virtual void OnPropertyChanged(string propertyName)
26 | {
27 | var handler = this.PropertyChanged;
28 | if (handler != null) {
29 | handler(this, new PropertyChangedEventArgs(propertyName));
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/ReadOnlyLinkGroupCollection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Input;
8 |
9 | namespace FirstFloor.ModernUI.Presentation
10 | {
11 | ///
12 | /// Represents a read-only observable collection of link groups.
13 | ///
14 | public class ReadOnlyLinkGroupCollection
15 | : ReadOnlyObservableCollection
16 | {
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// The with which to create this instance of the class.
21 | public ReadOnlyLinkGroupCollection(LinkGroupCollection list)
22 | : base(list)
23 | {
24 | this.List = list;
25 | }
26 |
27 | ///
28 | /// Provides access to the wrapped list.
29 | ///
30 | internal LinkGroupCollection List { get; private set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/FirstFloor.ModernUI/FirstFloor.ModernUI/Presentation/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FirstFloor.ModernUI.Presentation
8 | {
9 | ///
10 | /// The command that relays its functionality by invoking delegates.
11 | ///
12 | public class RelayCommand
13 | : CommandBase
14 | {
15 | private Action