remove load order display
This commit is contained in:
@@ -1,58 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Torch.Server.ViewModels;
|
|
||||||
using NLog;
|
|
||||||
using Torch.Collections;
|
|
||||||
|
|
||||||
namespace Torch.Server.Views.Converters
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A converter to get the index of a ModItemInfo object within a collection of ModItemInfo objects
|
|
||||||
/// </summary>
|
|
||||||
public class ModToListIdConverter : IMultiValueConverter
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Converts a ModItemInfo object into its index within a Collection of ModItemInfo objects
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="values">
|
|
||||||
/// Expected to contain a ModItemInfo object at index 0
|
|
||||||
/// and a Collection of ModItemInfo objects at index 1
|
|
||||||
/// </param>
|
|
||||||
/// <param name="targetType">This parameter will be ignored</param>
|
|
||||||
/// <param name="parameter">This parameter will be ignored</param>
|
|
||||||
/// <param name="culture"> This parameter will be ignored</param>
|
|
||||||
/// <returns>the index of the mod within the provided mod list.</returns>
|
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
//if (targetType != typeof(int))
|
|
||||||
// throw new NotSupportedException("ModToIdConverter can only convert mods into int values or vise versa!");
|
|
||||||
if (values[0] is ModItemInfo mod && values[1] is MtObservableList<ModItemInfo> modList)
|
|
||||||
{
|
|
||||||
return modList.IndexOf(mod);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// It is not supported to reverse this converter
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="values"></param>
|
|
||||||
/// <param name="targetType"></param>
|
|
||||||
/// <param name="parameter"></param>
|
|
||||||
/// <param name="culture"></param>
|
|
||||||
/// <returns>Raises a NotSupportedException</returns>
|
|
||||||
public object[] ConvertBack(object values, Type[] targetType, object parameter, CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotSupportedException("ModToIdConverter can not convert back!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -49,16 +49,6 @@
|
|||||||
AutoGenerateColumns="False">
|
AutoGenerateColumns="False">
|
||||||
<!--:DesignSource="{d:DesignInstance Type={x:Type MyObjectBuilder_Checkpoint:ModItem, CreateList=True}}">-->
|
<!--:DesignSource="{d:DesignInstance Type={x:Type MyObjectBuilder_Checkpoint:ModItem, CreateList=True}}">-->
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Header="Load Order"
|
|
||||||
Width="Auto"
|
|
||||||
IsReadOnly="True">
|
|
||||||
<DataGridTextColumn.Binding>
|
|
||||||
<MultiBinding Converter="{StaticResource ModToListIdConverter}" StringFormat="{}{0}">
|
|
||||||
<Binding />
|
|
||||||
<Binding ElementName="ModList" Path="DataContext"></Binding>
|
|
||||||
</MultiBinding>
|
|
||||||
</DataGridTextColumn.Binding>
|
|
||||||
</DataGridTextColumn>
|
|
||||||
<DataGridTextColumn Header="Workshop Id"
|
<DataGridTextColumn Header="Workshop Id"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Binding="{Binding PublishedFileId, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}">
|
Binding="{Binding PublishedFileId, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}">
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
</Style>
|
</Style>
|
||||||
<converters:ListConverter x:Key="ListConverterString" Type="system:String"/>
|
<converters:ListConverter x:Key="ListConverterString" Type="system:String"/>
|
||||||
<converters:ListConverter x:Key="ListConverterUInt64" Type="system:UInt64"/>
|
<converters:ListConverter x:Key="ListConverterUInt64" Type="system:UInt64"/>
|
||||||
<converters:ModToListIdConverter x:Key="ModToListIdConverter"/>
|
|
||||||
<converters:ListConverterWorkshopId x:Key="ListConverterWorkshopId"/>
|
<converters:ListConverterWorkshopId x:Key="ListConverterWorkshopId"/>
|
||||||
<converters:BooleanAndConverter x:Key="BooleanAndConverter"/>
|
<converters:BooleanAndConverter x:Key="BooleanAndConverter"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
Reference in New Issue
Block a user