mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
初始化 PetEditWindow
This commit is contained in:
parent
f013b7fecf
commit
e8f71384c8
@ -7,6 +7,7 @@
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
|
||||
<ResourceDictionary Source="Converters.xaml" />
|
||||
<ResourceDictionary Source="Styles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
7
VPet.Plugin.ModMaker/Converters.xaml
Normal file
7
VPet.Plugin.ModMaker/Converters.xaml
Normal file
@ -0,0 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="clr-namespace:VPet.Plugin.ModMaker.Converters">
|
||||
<c:MarginConverter x:Key="MarginConverter" />
|
||||
<c:MaxConverter x:Key="MaxConverter" />
|
||||
</ResourceDictionary>
|
75
VPet.Plugin.ModMaker/Converters/MarginConverter.cs
Normal file
75
VPet.Plugin.ModMaker/Converters/MarginConverter.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Converters;
|
||||
|
||||
public class MarginConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(
|
||||
object[] values,
|
||||
Type targetType,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
if (values.Length == 0)
|
||||
{
|
||||
return new Thickness();
|
||||
}
|
||||
else if (values.Length == 1)
|
||||
{
|
||||
return new Thickness()
|
||||
{
|
||||
Left = System.Convert.ToDouble(values[0]),
|
||||
Top = default,
|
||||
Right = default,
|
||||
Bottom = default
|
||||
};
|
||||
}
|
||||
else if (values.Length == 2)
|
||||
{
|
||||
return new Thickness()
|
||||
{
|
||||
Left = System.Convert.ToDouble(values[0]),
|
||||
Top = System.Convert.ToDouble(values[1]),
|
||||
Right = default,
|
||||
Bottom = default
|
||||
};
|
||||
}
|
||||
else if (values.Length == 3)
|
||||
{
|
||||
return new Thickness()
|
||||
{
|
||||
Left = System.Convert.ToDouble(values[0]),
|
||||
Top = System.Convert.ToDouble(values[1]),
|
||||
Right = System.Convert.ToDouble(values[2]),
|
||||
Bottom = default
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Thickness()
|
||||
{
|
||||
Left = System.Convert.ToDouble(values[0]),
|
||||
Top = System.Convert.ToDouble(values[1]),
|
||||
Right = System.Convert.ToDouble(values[2]),
|
||||
Bottom = System.Convert.ToDouble(values[3])
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public object[] ConvertBack(
|
||||
object value,
|
||||
Type[] targetTypes,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
32
VPet.Plugin.ModMaker/Converters/MaxConverter.cs
Normal file
32
VPet.Plugin.ModMaker/Converters/MaxConverter.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Converters;
|
||||
|
||||
public class MaxConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(
|
||||
object[] values,
|
||||
Type targetType,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
return values.Max(i => (double)i);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(
|
||||
object value,
|
||||
Type[] targetTypes,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
48
VPet.Plugin.ModMaker/Models/PetModel.cs
Normal file
48
VPet.Plugin.ModMaker/Models/PetModel.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using HKW.HKWViewModels.SimpleObservable;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Models;
|
||||
|
||||
public class PetModel
|
||||
{
|
||||
public ObservableValue<BitmapImage> Image { get; } = new();
|
||||
public ObservableValue<ObservableInt32Rect> TouchHeadRect { get; } = new(new());
|
||||
public ObservableValue<MultiStateRect> TouchRaisedRect { get; } = new(new());
|
||||
public ObservableValue<MultiStatePoint> RaisePoint { get; } = new(new());
|
||||
}
|
||||
|
||||
public class MultiStateRect
|
||||
{
|
||||
public ObservableValue<ObservableInt32Rect> Happy { get; } = new(new());
|
||||
public ObservableValue<ObservableInt32Rect> Nomal { get; } = new(new());
|
||||
public ObservableValue<ObservableInt32Rect> PoorCondition { get; } = new(new());
|
||||
public ObservableValue<ObservableInt32Rect> Ill { get; } = new(new());
|
||||
}
|
||||
|
||||
public class MultiStatePoint
|
||||
{
|
||||
public ObservableValue<ObservablePoint> Happy { get; } = new(new());
|
||||
public ObservableValue<ObservablePoint> Nomal { get; } = new(new());
|
||||
public ObservableValue<ObservablePoint> PoorCondition { get; } = new(new());
|
||||
public ObservableValue<ObservablePoint> Ill { get; } = new(new());
|
||||
}
|
||||
|
||||
public class ObservableInt32Rect
|
||||
{
|
||||
public ObservableValue<int> X { get; } = new();
|
||||
public ObservableValue<int> Y { get; } = new();
|
||||
public ObservableValue<int> Width { get; } = new();
|
||||
public ObservableValue<int> Height { get; } = new();
|
||||
}
|
||||
|
||||
public class ObservablePoint
|
||||
{
|
||||
public ObservableValue<double> X { get; } = new();
|
||||
public ObservableValue<double> Y { get; } = new();
|
||||
}
|
@ -30,9 +30,8 @@ internal static class Utils
|
||||
BitmapImage bitmapImage = new();
|
||||
bitmapImage.BeginInit();
|
||||
var ms = new MemoryStream();
|
||||
var sr = new StreamReader(imagePath);
|
||||
using var sr = new StreamReader(imagePath);
|
||||
sr.BaseStream.CopyTo(ms);
|
||||
sr.Close();
|
||||
bitmapImage.StreamSource = ms;
|
||||
bitmapImage.EndInit();
|
||||
return bitmapImage;
|
||||
|
@ -89,11 +89,14 @@
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Converters\MaxConverter.cs" />
|
||||
<Compile Include="Converters\MarginConverter.cs" />
|
||||
<Compile Include="Models\ClickTextModel.cs" />
|
||||
<Compile Include="Models\FoodModel.cs" />
|
||||
<Compile Include="Models\I18nHelper.cs" />
|
||||
<Compile Include="Models\II18nData.cs" />
|
||||
<Compile Include="Models\LowTextModel.cs" />
|
||||
<Compile Include="Models\PetModel.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\FoodEdit\FoodPageVM.cs" />
|
||||
@ -101,6 +104,8 @@
|
||||
<Compile Include="ViewModels\ModEdit\LowTextEdit\LowTextEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\LowTextEdit\LowTextPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ModEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\PetEdit\PetEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\PetEdit\PetPageVM.cs" />
|
||||
<Compile Include="Views\ModEdit\ClickTextEdit\ClickTextPage.xaml.cs">
|
||||
<DependentUpon>ClickTextPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -145,6 +150,12 @@
|
||||
<DependentUpon>ModEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\ModMakerWindowVM.cs" />
|
||||
<Compile Include="Views\ModEdit\PetEdit\PetEditWindow.xaml.cs">
|
||||
<DependentUpon>PetEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\PetEdit\PetPage.xaml.cs">
|
||||
<DependentUpon>PetPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModMakerWindow.xaml.cs">
|
||||
<DependentUpon>ModMakerWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -163,6 +174,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Converters.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\ClickTextEdit\ClickTextPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -195,6 +210,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\PetEdit\PetEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\PetEdit\PetPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModMakerWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
@ -0,0 +1,17 @@
|
||||
using HKW.HKWViewModels.SimpleObservable;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using VPet.Plugin.ModMaker.Models;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
|
||||
|
||||
public class PetEditWindowVM
|
||||
{
|
||||
public ObservableValue<PetModel> Pet { get; } = new(new());
|
||||
|
||||
public PetEditWindowVM() { }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
|
||||
|
||||
public class PetPageVM { }
|
@ -119,43 +119,43 @@
|
||||
<pu:NumberInput
|
||||
x:Name="NumberInput_StrengthFood"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.StrengthFood.Value}" />
|
||||
Value="{Binding Food.Value.StrengthFood.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="2" Content="口渴值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.StrengthDrink.Value}" />
|
||||
Value="{Binding Food.Value.StrengthDrink.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="3" Content="健康值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Health.Value}" />
|
||||
Value="{Binding Food.Value.Health.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="4" Content="体力值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Strength.Value}" />
|
||||
Value="{Binding Food.Value.Strength.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="5" Content="心情值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Feeling.Value}" />
|
||||
Value="{Binding Food.Value.Feeling.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="6" Content="好感值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Likability.Value}" />
|
||||
Value="{Binding Food.Value.Likability.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="7" Content="经验值:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Exp.Value}" />
|
||||
Value="{Binding Food.Value.Exp.Value, Mode=TwoWay}" />
|
||||
<Label Grid.Row="8" Content="价格:" />
|
||||
<pu:NumberInput
|
||||
x:Name="NumberInput_Price"
|
||||
Grid.Row="8"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Food.Value.Price.Value}" />
|
||||
Value="{Binding Food.Value.Price.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="2">
|
||||
|
720
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml
Normal file
720
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml
Normal file
@ -0,0 +1,720 @@
|
||||
<Window
|
||||
x:Class="VPet.Plugin.ModMaker.Views.ModEdit.PetEdit.PetEditWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:VPet.Plugin.ModMaker.Views.ModEdit.PetEdit"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit"
|
||||
Title="PetEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:PetEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Window.Resources>
|
||||
<Style
|
||||
x:Key="Label_ThouchRect"
|
||||
BasedOn="{StaticResource {x:Type Label}}"
|
||||
TargetType="Label">
|
||||
<Setter Property="Visibility" Value="Collapsed" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="#19FF0000" />
|
||||
<Setter Property="BorderBrush" Value="Red" />
|
||||
<Setter Property="Width" Value="{Binding Width.Value}" />
|
||||
<Setter Property="Height" Value="{Binding Height.Value}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Mode=Self}}" Value="True">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<!--
|
||||
Width="{Binding Pet.Value.Image.Value.Width}"
|
||||
Height="{Binding Pet.Value.Image.Value.Height}"
|
||||
-->
|
||||
<Image
|
||||
d:Height="250"
|
||||
d:Width="250"
|
||||
Source="C:\Users\HKW\Desktop\测试肖像文件夹\10500.png" />
|
||||
<Label
|
||||
Content="TouchHeadRect"
|
||||
DataContext="{Binding Pet.Value.TouchHeadRect.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchHead}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Content="TouchRaisedRect_Happy"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Happy.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchRaisedRect_HappyState}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Content="TouchRaisedRect_Nomal"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Nomal.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchRaisedRect_NomalState}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Content="TouchRaisedRect_PoorCondition"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.PoorCondition.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchRaisedRect_PoorConditionState}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Content="TouchRaisedRect_Ill"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Ill.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchRaisedRect_IllState}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Width="5"
|
||||
Height="5"
|
||||
Background="Red"
|
||||
Content="RaisePoint_Happy"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Happy.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_RaisePoint_Happy}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Width="5"
|
||||
Height="5"
|
||||
Background="Red"
|
||||
Content="RaisePoint_Nomal"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Nomal.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_RaisePoint_Nomal}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Width="5"
|
||||
Height="5"
|
||||
Background="Red"
|
||||
Content="RaisePoint_PoorCondition"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.PoorCondition.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_RaisePoint_PoorCondition}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
<Label
|
||||
Width="5"
|
||||
Height="5"
|
||||
Background="Red"
|
||||
Content="RaisePoint_Ill"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Ill.Value}"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_RaisePoint_Ill}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
<Binding Path="X.Value" />
|
||||
<Binding Path="Y.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
</Label>
|
||||
</Grid>
|
||||
<!--<Grid Grid.Row="1" >
|
||||
<TextBox/>
|
||||
</Grid>-->
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_TouchHead"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
DataContext="{Binding Pet.Value.TouchHeadRect.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="TouchHead:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Background="{x:Null}"
|
||||
Content="w:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding Width.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="h:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Height.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<Expander Header="TouchRaisedRect">
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_TouchRaisedRect_HappyState"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
d:IsChecked="True"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Happy.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="HappyState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Background="{x:Null}"
|
||||
Content="w:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding Width.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="h:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Height.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_TouchRaisedRect_NomalState"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
d:IsChecked="True"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Nomal.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="NomalState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Background="{x:Null}"
|
||||
Content="w:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding Width.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="h:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Height.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_TouchRaisedRect_PoorConditionState"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
d:IsChecked="True"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.PoorCondition.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="PoorConditionState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Background="{x:Null}"
|
||||
Content="w:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding Width.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="h:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Height.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_TouchRaisedRect_IllState"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
d:IsChecked="True"
|
||||
DataContext="{Binding Pet.Value.TouchRaisedRect.Value.Ill.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="IllState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Background="{x:Null}"
|
||||
Content="w:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding Width.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="h:" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Height.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
<Expander Header="RaisePoint">
|
||||
<StackPanel>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_RaisePoint_Happy"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Happy.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="HappyState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_RaisePoint_Nomal"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Nomal.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="NomalState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_RaisePoint_PoorCondition"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.PoorCondition.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="PoorConditionState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton_RaisePoint_Ill"
|
||||
Padding="5"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
DataContext="{Binding Pet.Value.RaisePoint.Value.Ill.Value}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{x:Null}"
|
||||
Content="IllState:" />
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Background="{x:Null}" Content="x:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="1"
|
||||
d:Value="100"
|
||||
Value="{Binding X.Value, Mode=TwoWay}" />
|
||||
<Label
|
||||
Grid.Column="2"
|
||||
Background="{x:Null}"
|
||||
Content="y:" />
|
||||
<pu:NumberInput
|
||||
Grid.Column="3"
|
||||
d:Value="100"
|
||||
Value="{Binding Y.Value, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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.Shapes;
|
||||
using VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
|
||||
|
||||
/// <summary>
|
||||
/// PetEditWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PetEditWindow : Window
|
||||
{
|
||||
public PetEditWindowVM ViewModel => (PetEditWindowVM)DataContext;
|
||||
|
||||
public PetEditWindow()
|
||||
{
|
||||
DataContext = new PetEditWindowVM();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
14
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml
Normal file
14
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml
Normal file
@ -0,0 +1,14 @@
|
||||
<Page x:Class="VPet.Plugin.ModMaker.Views.ModEdit.PetEdit.PetPage"
|
||||
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:VPet.Plugin.ModMaker.Views.ModEdit.PetEdit"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="PetPage">
|
||||
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
31
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml.cs
Normal file
31
VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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;
|
||||
using VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
|
||||
|
||||
/// <summary>
|
||||
/// PetPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PetPage : Page
|
||||
{
|
||||
public PetPageVM ViewModel => (PetPageVM)DataContext;
|
||||
|
||||
public PetPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new PetPageVM();
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ using System.Windows.Shapes;
|
||||
using VPet.Plugin.ModMaker.Models;
|
||||
using VPet.Plugin.ModMaker.ViewModels;
|
||||
using VPet.Plugin.ModMaker.Views.ModEdit;
|
||||
using VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
|
||||
|
||||
namespace VPet.Plugin.ModMaker.Views;
|
||||
|
||||
@ -23,7 +24,7 @@ namespace VPet.Plugin.ModMaker.Views;
|
||||
/// </summary>
|
||||
public partial class ModMakerWindow : Window
|
||||
{
|
||||
public WindowVM_ModMaker ViewModel => (WindowVM_ModMaker)this.DataContext;
|
||||
public WindowVM_ModMaker ViewModel => (WindowVM_ModMaker)DataContext;
|
||||
public Models.ModMaker ModMaker { get; set; }
|
||||
public ModEditWindow ModEditWindow { get; set; }
|
||||
|
||||
@ -31,5 +32,6 @@ public partial class ModMakerWindow : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new WindowVM_ModMaker(this);
|
||||
new PetEditWindow().Show();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user