Initial commit to new repository
This commit is contained in:
29
.decompiledproj/AxCopilot/Themes/IndexToNumberConverter.cs
Normal file
29
.decompiledproj/AxCopilot/Themes/IndexToNumberConverter.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AxCopilot.Themes;
|
||||
|
||||
public class IndexToNumberConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type t, object p, CultureInfo c)
|
||||
{
|
||||
if (value is ListViewItem container)
|
||||
{
|
||||
ItemsControl itemsControl = ItemsControl.ItemsControlFromItemContainer((DependencyObject)(object)container);
|
||||
if (itemsControl != null)
|
||||
{
|
||||
int num = itemsControl.ItemContainerGenerator.IndexFromContainer((DependencyObject)(object)container);
|
||||
return (num >= 0 && num < 9) ? (num + 1).ToString() : "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public object ConvertBack(object v, Type t, object p, CultureInfo c)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user