Skip to content

Commit

Permalink
添加导航页面
Browse files Browse the repository at this point in the history
  • Loading branch information
walterlv committed Oct 18, 2020
1 parent 48c1b0c commit 5022e12
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/AboutPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<UserControl x:Class="Xiu2.TileTool.Views.AboutPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Xiu2.TileTool.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>

</Grid>
</UserControl>
26 changes: 26 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Xiu2.TileTool.Views
{
/// <summary>
/// AboutPage.xaml 的交互逻辑
/// </summary>
public partial class AboutPage : UserControl
{
public AboutPage()
{
InitializeComponent();
}
}
}
13 changes: 13 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/AboutViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xiu2.TileTool.Views
{
public class AboutViewModel
{

}
}
12 changes: 12 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/EditTilePage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<UserControl x:Class="Xiu2.TileTool.Views.EditTilePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Xiu2.TileTool.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>

</Grid>
</UserControl>
26 changes: 26 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/EditTilePage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Xiu2.TileTool.Views
{
/// <summary>
/// EditTilePage.xaml 的交互逻辑
/// </summary>
public partial class EditTilePage : UserControl
{
public EditTilePage()
{
InitializeComponent();
}
}
}
13 changes: 13 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/EditTileViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xiu2.TileTool.Views
{
public class EditTileViewModel
{

}
}
21 changes: 21 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xiu2.TileTool.UIFramework;

namespace Xiu2.TileTool.Views
{
public class MainViewModel : BindableObject
{
public ObservableCollection<NavigationItem> NavigationItems { get; } = new ObservableCollection<NavigationItem>
{
NavigationItem.Combine<EditTilePage, EditTileViewModel>("新建/编辑磁贴"),
NavigationItem.Combine<AboutPage, AboutViewModel>("关于"),
NavigationItem.Combine<SettingsPage, SettingsViewModel>("设置"),
};
}
}
29 changes: 28 additions & 1 deletion src/磁贴美化小工具.Wpf/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Xiu2.TileTool.Views"
xmlns:uf="clr-namespace:Xiu2.TileTool.UIFramework"
mc:Ignorable="d" Height="450" Width="800"
Style="{StaticResource Style.Window}"
Topmost="True" Background="{StaticResource Brush.Theme.Background}">
<Window.DataContext>
<local:MainViewModel />
</Window.DataContext>
<Window.Resources>
<DataTemplate x:Key="Template.NavigationItem">
<Grid>
<ContentPresenter />
<Border BorderThickness="4"
Background="{StaticResource Brush.Theme}"
HorizontalAlignment="Left"
SnapsToDevicePixels="True" />
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>

<Grid.RowDefinitions>
<RowDefinition Height="32" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ItemsControl Grid.Row="1" Grid.Column="0"
ItemsSource="{Binding NavigationItems, Mode=OneTime}"
ItemTemplate="{StaticResource Template.NavigationItem}">

</ItemsControl>
</Grid>
</Window>
12 changes: 12 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/SettingsPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<UserControl x:Class="Xiu2.TileTool.Views.SettingsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Xiu2.TileTool.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>

</Grid>
</UserControl>
26 changes: 26 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Xiu2.TileTool.Views
{
/// <summary>
/// SettingsPage.xaml 的交互逻辑
/// </summary>
public partial class SettingsPage : UserControl
{
public SettingsPage()
{
InitializeComponent();
}
}
}
13 changes: 13 additions & 0 deletions src/磁贴美化小工具.Wpf/Views/SettingsViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xiu2.TileTool.Views
{
public class SettingsViewModel
{

}
}

0 comments on commit 5022e12

Please sign in to comment.