refactor: move non-observable object from ViewModels to Models

* ViewModels.MergeMode -> Models.MergeMode
* ViewModels.Notification -> Models.Notification
* ViewModels.ResetMode -> Models.ResetMode
* use `int` instead of `ViewModels.CountSelectedCommits`
This commit is contained in:
leo 2024-07-24 11:44:13 +08:00
parent 0dee3a1969
commit 9e048751ae
No known key found for this signature in database
13 changed files with 74 additions and 82 deletions

View file

@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:m="using:SourceGit.Models"
xmlns:vm="using:SourceGit.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SourceGit.Views.Merge"
@ -36,10 +37,10 @@
<ComboBox Grid.Row="2" Grid.Column="1"
Height="28" Padding="8,0"
VerticalAlignment="Center" HorizontalAlignment="Stretch"
ItemsSource="{Binding Modes}"
ItemsSource="{Binding Source={x:Static m:MergeMode.Supported}}"
SelectedItem="{Binding SelectedMode, Mode=TwoWay}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="vm:MergeMode">
<DataTemplate DataType="m:MergeMode">
<StackPanel Orientation="Horizontal" Height="20" VerticalAlignment="Center">
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Desc}" Margin="8,0,0,0" FontSize="11" Foreground="{DynamicResource Brush.FG2}"/>