- 在宠物列表页面添加 `不显示本体宠物` 按钮 (默认开启)

更新:
- *自动设置食物推荐价格* 可在当前模组编辑时继承
- 历史编辑按最后编辑时间倒序排序
This commit is contained in:
Hakoyu 2023-12-14 23:27:08 +08:00
parent 8a9a8d2ca3
commit e53acb283a
24 changed files with 391 additions and 66 deletions

View File

@ -13,4 +13,5 @@
<c:EqualsConverter x:Key="EqualsConverter" />
<c:NotEqualsConverter x:Key="NotEqualsConverter" />
<c:NullToFalseConverter x:Key="NullToFalseConverter" />
<c:AllTrueToCollapsedConverter x:Key="AllTrueToCollapsedConverter" />
</ResourceDictionary>

View File

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace VPet.ModMaker.Converters;
/// <summary>
/// 全部为真时设置隐藏转换器
/// </summary>
public class AllTrueToCollapsedConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 0)
throw new ArgumentException("No values", nameof(values));
return values.All(i => i is true) ? Visibility.Collapsed : Visibility.Visible;
}
public object[] ConvertBack(
object value,
Type[] targetTypes,
object parameter,
CultureInfo culture
)
{
throw new NotImplementedException();
}
}

View File

@ -0,0 +1,28 @@
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace VPet.ModMaker.Converters;
/// <summary>
/// 任意为假时设置显示转换器
/// </summary>
public class AnyFalseToVisibleConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 0)
throw new ArgumentException("No values", nameof(values));
return values.Any(i => i is not true) ? Visibility.Visible : Visibility.Collapsed;
}
public object[] ConvertBack(
object value,
Type[] targetTypes,
object parameter,
CultureInfo culture
)
{
throw new NotImplementedException();
}
}

View File

@ -2,12 +2,14 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VPet.ModMaker.Models;
// TODO: 更新事件
/// <summary>
/// I18n助手
/// </summary>
@ -33,10 +35,7 @@ public class I18nHelper
CultureNames.CollectionChanged += Cultures_CollectionChanged;
}
private void Cultures_CollectionChanged(
object sender,
System.Collections.Specialized.NotifyCollectionChangedEventArgs e
)
private void Cultures_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
// 替换
if (e.NewStartingIndex == e.OldStartingIndex)

View File

@ -0,0 +1,89 @@
using HKW.HKWUtils.Observable;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VPet.ModMaker.Models;
/// <summary>
/// I18n模型
/// </summary>
/// <typeparam name="T">类型</typeparam>
public class I18nModelBase<T> : ObservableClass<I18nModelBase<T>>
where T : class, new()
{
/// <summary>
/// 当前I18n数据
/// </summary>
private T _CurrentI18nData = new();
public T CurrentI18nData
{
get => _CurrentI18nData;
set => SetProperty(ref _CurrentI18nData, value);
}
/// <summary>
/// 所有I18n数据
/// </summary>
public Dictionary<string, T> I18nDatas { get; } = new();
public I18nModelBase()
{
I18nHelper.Current.CultureName.ValueChanged += CultureChanged;
I18nHelper.Current.AddCulture += AddCulture;
I18nHelper.Current.RemoveCulture += RemoveCulture;
I18nHelper.Current.ReplaceCulture += ReplaceCulture;
if (I18nHelper.Current.CultureNames.Count == 0)
return;
foreach (var item in I18nHelper.Current.CultureNames)
I18nDatas.Add(item, new());
CurrentI18nData = I18nDatas[I18nHelper.Current.CultureName.Value];
}
/// <summary>
/// 文化改变
/// </summary>
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
private void CultureChanged(ObservableValue<string> sender, ValueChangedEventArgs<string> e)
{
if (e.NewValue is null)
CurrentI18nData = null;
else if (I18nDatas.TryGetValue(e.NewValue, out var result))
CurrentI18nData = result;
}
/// <summary>
/// 添加文化
/// </summary>
/// <param name="culture">文化名称</param>
private void AddCulture(string culture)
{
if (I18nDatas.ContainsKey(culture) is false)
I18nDatas.Add(culture, new());
}
/// <summary>
/// 删除文化
/// </summary>
/// <param name="culture">文化名称</param>
private void RemoveCulture(string culture)
{
I18nDatas.Remove(culture);
}
/// <summary>
/// 替换文化
/// </summary>
/// <param name="oldCulture">旧文化名称</param>
/// <param name="newCulture">新文化名称</param>
private void ReplaceCulture(string oldCulture, string newCulture)
{
var item = I18nDatas[oldCulture];
I18nDatas.Remove(oldCulture);
I18nDatas.Add(newCulture, item);
}
}

View File

@ -21,12 +21,22 @@ using VPet_Simulator.Windows.Interface;
namespace VPet.ModMaker.Models;
// TODO: 本体模组显示开关
/// <summary>
/// 模组信息模型
/// </summary>
public class ModInfoModel : I18nModel<I18nModInfoModel>
{
/// <summary>
/// 自动设置食物推荐价格
/// </summary>
public ObservableValue<bool> AutoSetFoodPrice { get; } = new();
/// <summary>
/// 不显示本体宠物
/// </summary>
public ObservableValue<bool> DontShowMainPet { get; } = new(true);
#region ModInfo
/// <summary>
/// 作者Id
/// </summary>
@ -77,6 +87,9 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
/// </summary>
public ObservableValue<string> SourcePath { get; } = new();
#endregion
#region ModDatas
/// <summary>
/// 食物
/// </summary>
@ -102,6 +115,11 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
/// </summary>
public ObservableCollection<PetModel> Pets { get; } = new();
/// <summary>
/// 宠物实际数量
/// </summary>
public ObservableValue<int> PetDisplayedCount { get; } = new();
/// <summary>
/// 其它I18n数据
/// </summary>
@ -111,7 +129,7 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
/// 需要保存的I18n数据
/// </summary>
public static Dictionary<string, Dictionary<string, string>> SaveI18nDatas { get; } = new();
#endregion
public ModInfoModel()
{
DescriptionId.Value = $"{Id.Value}_{nameof(DescriptionId)}";
@ -119,6 +137,24 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
{
DescriptionId.Value = $"{n}_{nameof(DescriptionId)}";
};
Pets.CollectionChanged += Pets_CollectionChanged;
DontShowMainPet.ValueChanged += ShowMainPet_ValueChanged;
}
private void ShowMainPet_ValueChanged(
ObservableValue<bool> sender,
ValueChangedEventArgs<bool> e
)
{
Pets_CollectionChanged(null, null);
}
private void Pets_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (DontShowMainPet.Value)
PetDisplayedCount.Value = Pets.Count - Pets.Count(m => m.FromMain.Value);
else
PetDisplayedCount.Value = Pets.Count;
}
public ModInfoModel(ModLoader loader)
@ -178,6 +214,9 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
LoadAnime(petModel, p);
}
loader.Pets.First().Name = "TestMainPet";
Pets.Insert(0, new(loader.Pets.First(), true));
// 插入本体宠物
foreach (var pet in ModMakerInfo.MainPets)
{

View File

@ -33,13 +33,13 @@
<pu:NumberInput
Grid.Column="1"
ToolTip="{Binding Value, RelativeSource={RelativeSource Mode=Self}}"
Value="{Binding DataContext.Min.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
Value="{Binding DataContext.Min, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" />
<Label Grid.Row="1" Content="{ll:Str 最大值}" />
<pu:NumberInput
Grid.Row="1"
Grid.Column="1"
ToolTip="{Binding Value, RelativeSource={RelativeSource Mode=Self}}"
Value="{Binding DataContext.Max.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
Value="{Binding DataContext.Max, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" />
</Grid>
</Grid>
</ControlTemplate>

View File

@ -5,5 +5,6 @@ global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
global using global::System.Collections.ObjectModel;
global using global::HKW.HKWUtils;
global using global::HKW.HKWUtils.Observable;

View File

@ -98,6 +98,9 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Converters\AllTrueToCollapsedConverter.cs" />
<Compile Include="Converters\AnyFalseToVisibleConverter.cs" />
<Compile Include="Models\I18nModelBase.cs" />
<Compile Include="Usings.cs" />
<Compile Include="Converters\BrushToMediaColorConverter.cs" />
<Compile Include="Converters\CalculatorConverter.cs" />

View File

@ -18,6 +18,8 @@ namespace VPet.ModMaker.ViewModels.ModEdit.AnimeEdit;
public class AnimePageVM
{
public static ModInfoModel ModInfo => ModInfoModel.Current;
#region Value
/// <summary>
/// 显示的动画

View File

@ -17,17 +17,16 @@ namespace VPet.ModMaker.ViewModels.ModEdit.FoodEdit;
public class FoodEditWindowVM
{
public I18nHelper I18nData => I18nHelper.Current;
public static ModInfoModel ModInfo => ModInfoModel.Current;
public static I18nHelper I18nData => I18nHelper.Current;
#region Value
public FoodModel OldFood { get; set; }
public ObservableValue<FoodModel> Food { get; } = new(new());
public ObservableValue<bool> AutoSetReferencePrice { get; } = new(false);
#endregion
#region Command
public ObservableCommand AddImageCommand { get; } = new();
public ObservableCommand ChangeImageCommand { get; } = new();
public ObservableCommand<double> SetReferencePriceCommand { get; } = new();
#endregion
@ -35,28 +34,16 @@ public class FoodEditWindowVM
{
AddImageCommand.ExecuteCommand += AddImage;
ChangeImageCommand.ExecuteCommand += ChangeImage;
AutoSetReferencePrice.ValueChanged += AutoSetReferencePrice_ValueChanged;
SetReferencePriceCommand.ExecuteCommand += SetReferencePriceToPrice;
Food.Value.ReferencePrice.ValueChanged += ReferencePrice_ValueChanged;
}
private void AutoSetReferencePrice_ValueChanged(
ObservableValue<bool> sender,
ValueChangedEventArgs<bool> e
)
{
if (e.NewValue)
{
SetReferencePriceToPrice(Food.Value.ReferencePrice.Value);
}
}
private void ReferencePrice_ValueChanged(
ObservableValue<double> sender,
ValueChangedEventArgs<double> e
)
{
if (AutoSetReferencePrice.Value)
if (ModInfo.AutoSetFoodPrice.Value)
{
SetReferencePriceToPrice(e.NewValue);
}

View File

@ -15,6 +15,7 @@ namespace VPet.ModMaker.ViewModels.ModEdit.MoveEdit;
public class MovePageVM
{
public static ModInfoModel ModInfo => ModInfoModel.Current;
#region Value
public ObservableValue<ObservableCollection<MoveModel>> ShowMoves { get; } = new();
public ObservableCollection<MoveModel> Moves => CurrentPet.Value.Moves;

View File

@ -17,6 +17,7 @@ namespace VPet.ModMaker.ViewModels.ModEdit.PetEdit;
public class PetPageVM
{
public static ModInfoModel ModInfo => ModInfoModel.Current;
#region Value
public ObservableValue<ObservableCollection<PetModel>> ShowPets { get; } = new();
public ObservableCollection<PetModel> Pets => ModInfoModel.Current.Pets;

View File

@ -14,7 +14,8 @@ namespace VPet.ModMaker.ViewModels.ModEdit.WorkEdit;
public class WorkEditWindowVM
{
public I18nHelper I18nData => I18nHelper.Current;
public static ModInfoModel ModInfo => ModInfoModel.Current;
public static I18nHelper I18nData => I18nHelper.Current;
#region Value
public PetModel CurrentPet { get; set; }
public WorkModel OldWork { get; set; }

View File

@ -15,6 +15,7 @@ namespace VPet.ModMaker.ViewModels.ModEdit.WorkEdit;
public class WorkPageVM
{
public static ModInfoModel ModInfo => ModInfoModel.Current;
#region Value
public ObservableValue<ObservableCollection<WorkModel>> ShowWorks { get; } = new();
public ObservableCollection<WorkModel> Works => CurrentPet.Value.Works;

View File

@ -40,7 +40,7 @@ public class ModMakerWindowVM
/// <summary>
/// 历史
/// </summary>
public ObservableCollection<ModMakeHistory> Histories { get; } = new();
public ObservableCollection<ModMakeHistory> Histories { get; set; } = new();
#endregion
#region Command
/// <summary>
@ -108,6 +108,7 @@ public class ModMakerWindowVM
if (Histories.All(h => h.InfoFile != history.InfoFile))
Histories.Add(history);
}
Histories = new(Histories.OrderByDescending(h => h.LastTime));
}
/// <summary>

View File

@ -45,6 +45,14 @@
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">
<Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" />
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource AllTrueToCollapsedConverter}">
<Binding Path="DataContext.ModInfo.DontShowMainPet.Value" RelativeSource="{RelativeSource AncestorType=Page}" />
<Binding Path="FromMain.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBox.ItemTemplate>

View File

@ -81,68 +81,116 @@
IsReadOnly="True"
SortMemberPath="WorkingState.Value" />
<DataGridTextColumn
Binding="{Binding DayTime.EnumValue.Value}"
Binding="{Binding DayTime.EnumValue}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 时间}"
IsReadOnly="True"
SortMemberPath="DayTime.EnumValue.Value" />
SortMemberPath="DayTime.EnumValue" />
<DataGridTextColumn
Binding="{Binding Like.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 好感度范围}"
IsReadOnly="True"
SortMemberPath="Like.Info.Value" />
SortMemberPath="Like.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Like.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Health.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 健康度范围}"
IsReadOnly="True"
SortMemberPath="Health.Info.Value" />
SortMemberPath="Health.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Health.Min" />
<Binding Path="Health.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Level.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 等级范围}"
IsReadOnly="True"
SortMemberPath="Level.Info.Value" />
SortMemberPath="Level.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Level.Min" />
<Binding Path="Level.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Money.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 金钱范围}"
IsReadOnly="True"
SortMemberPath="Money.Info.Value" />
SortMemberPath="Money.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Money.Min" />
<Binding Path="Money.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Food.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 食物范围}"
IsReadOnly="True"
SortMemberPath="Food.Info.Value" />
SortMemberPath="Food.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Food.Min" />
<Binding Path="Food.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Drink.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 口渴范围}"
IsReadOnly="True"
SortMemberPath="Drink.Info.Value" />
SortMemberPath="Drink.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Drink.Min" />
<Binding Path="Drink.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Feel.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 心情范围}"
IsReadOnly="True"
SortMemberPath="Feel.Info.Value" />
SortMemberPath="Feel.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Feel.Min" />
<Binding Path="Feel.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Strength.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 体力范围}"
IsReadOnly="True"
SortMemberPath="Strength.Info.Value" />
SortMemberPath="Strength.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Strength.Min" />
<Binding Path="Strength.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<Button

View File

@ -177,7 +177,7 @@
BoxHeight="16"
BoxWidth="30"
Content="{ll:Str 自动设置}"
IsChecked="{Binding AutoSetReferencePrice.Value}" />
IsChecked="{Binding ModInfo.AutoSetFoodPrice.Value}" />
</Grid>
</Grid>
</ScrollViewer>

View File

@ -176,7 +176,7 @@
<TabItem.Header>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
<Binding Path="ModInfo.Value.Pets.Count" />
<Binding Path="ModInfo.Value.PetDisplayedCount.Value" />
</MultiBinding>
</TabItem.Header>
<Frame Content="{Binding ModEditWindow.PetPage}" />

View File

@ -45,6 +45,14 @@
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">
<Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" />
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource AllTrueToCollapsedConverter}">
<Binding Path="DataContext.ModInfo.DontShowMainPet.Value" RelativeSource="{RelativeSource AncestorType=Page}" />
<Binding Path="FromMain.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBox.ItemTemplate>

View File

@ -18,10 +18,20 @@
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox
pu:TextBoxHelper.Watermark="{ll:Str 搜索Id}"
Style="{DynamicResource StandardTextBoxStyle}"
Text="{Binding Search.Value, UpdateSourceTrigger=PropertyChanged}" />
<pu:Switch
Grid.Column="1"
Content="{ll:Str 不显示本体宠物}"
IsChecked="{Binding ModInfo.DontShowMainPet.Value}" />
</Grid>
<DataGrid
Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}"
@ -40,6 +50,14 @@
<Setter Property="Height" Value="64" />
<Setter Property="Tag" Value="{Binding}" />
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_DataGridRow}" />
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource AllTrueToCollapsedConverter}">
<Binding Path="DataContext.ModInfo.DontShowMainPet.Value" RelativeSource="{RelativeSource AncestorType=Page}" />
<Binding Path="FromMain.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>

View File

@ -91,61 +91,109 @@
IsReadOnly="True"
SortMemberPath="Mode.EnumValue" />
<DataGridTextColumn
Binding="{Binding Like.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 好感度范围}"
IsReadOnly="True"
SortMemberPath="Like.Info.Value" />
SortMemberPath="Like.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Like.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Health.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 健康度范围}"
IsReadOnly="True"
SortMemberPath="Health.Info.Value" />
SortMemberPath="Health.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Health.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Level.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 等级范围}"
IsReadOnly="True"
SortMemberPath="Level.Info.Value" />
SortMemberPath="Level.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Level.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Money.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 金钱范围}"
IsReadOnly="True"
SortMemberPath="Money.Info.Value" />
SortMemberPath="Money.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Money.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Food.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 食物范围}"
IsReadOnly="True"
SortMemberPath="Food.Info.Value" />
SortMemberPath="Food.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Food.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Drink.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 口渴范围}"
IsReadOnly="True"
SortMemberPath="Drink.Info.Value" />
SortMemberPath="Drink.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Drink.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Feel.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 心情范围}"
IsReadOnly="True"
SortMemberPath="Feel.Info.Value" />
SortMemberPath="Feel.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Feel.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Strength.Info.Value}"
CanUserSort="True"
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
Header="{ll:Str 体力范围}"
IsReadOnly="True"
SortMemberPath="Strength.Info.Value" />
SortMemberPath="Strength.Min">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="({0} ~ {1})">
<Binding Path="Strength.Min" />
<Binding Path="Like.Max" />
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<Button

View File

@ -49,6 +49,14 @@
<ComboBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ComboBoxItem}}" TargetType="ComboBoxItem">
<Setter Property="ToolTip" Value="{Binding CurrentI18nData.Value.Name.Value}" />
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource AllTrueToCollapsedConverter}">
<Binding Path="DataContext.ModInfo.DontShowMainPet.Value" RelativeSource="{RelativeSource AncestorType=Page}" />
<Binding Path="FromMain.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBox.ItemTemplate>