Synchronize the Net40
This commit is contained in:
1 parent
5f299e988e
commit
a5a20d51ae
23 files changed
+393
-225
No files matched your search
@@ -350,6 +350,13 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (ItemsHost == null) return;
|
if (ItemsHost == null) return;
|
||||||
|
|
||||||
|
if (e.Action == NotifyCollectionChangedAction.Reset)
|
||||||
|
{
|
||||||
|
ClearItems();
|
||||||
|
ItemsHost?.Children.Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (e.OldItems != null)
|
if (e.OldItems != null)
|
||||||
{
|
{
|
||||||
foreach (var item in e.OldItems)
|
foreach (var item in e.OldItems)
|
||||||
|
|||||||
@@ -337,7 +337,7 @@
|
|||||||
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
|
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
|
||||||
<Compile Include="ViewModel\DemoViewModelBase.cs" />
|
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
|
||||||
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\ImageBrowserDemoViewModel.cs" />
|
<Compile Include="ViewModel\Controls\ImageBrowserDemoViewModel.cs" />
|
||||||
|
|||||||
@@ -6,21 +6,19 @@
|
|||||||
DataContext="{Binding CoverView,Source={StaticResource Locator}}"
|
DataContext="{Binding CoverView,Source={StaticResource Locator}}"
|
||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<controls:TransitioningContentControl>
|
<controls:TransitioningContentControl>
|
||||||
<StackPanel>
|
<controls:CoverView Margin="27" Width="880" Height="432" ItemWidth="160" ItemHeight="160" ItemsSource="{Binding DataList}">
|
||||||
<controls:CoverView Margin="27" Width="880" Height="432" ItemWidth="160" ItemHeight="160" ItemsSource="{Binding DataList}">
|
<controls:CoverView.ItemHeaderTemplate>
|
||||||
<controls:CoverView.ItemHeaderTemplate>
|
<DataTemplate>
|
||||||
<DataTemplate>
|
<Image Source="{Binding ImgPath}"/>
|
||||||
<Image Source="{Binding ImgPath}"/>
|
</DataTemplate>
|
||||||
</DataTemplate>
|
</controls:CoverView.ItemHeaderTemplate>
|
||||||
</controls:CoverView.ItemHeaderTemplate>
|
<controls:CoverView.ItemTemplate>
|
||||||
<controls:CoverView.ItemTemplate>
|
<DataTemplate>
|
||||||
<DataTemplate>
|
<Border Margin="10" Height="300" Background="{Binding BackgroundToken,Converter={StaticResource String2BrushConverter}}">
|
||||||
<Border Margin="10" Height="300" Background="{Binding BackgroundToken,Converter={StaticResource String2BrushConverter}}">
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
</Border>
|
||||||
</Border>
|
</DataTemplate>
|
||||||
</DataTemplate>
|
</controls:CoverView.ItemTemplate>
|
||||||
</controls:CoverView.ItemTemplate>
|
</controls:CoverView>
|
||||||
</controls:CoverView>
|
|
||||||
</StackPanel>
|
|
||||||
</controls:TransitioningContentControl>
|
</controls:TransitioningContentControl>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
File renamed without changes.
@@ -0,0 +1,9 @@
|
|||||||
|
namespace HandyControlDemo.Data
|
||||||
|
{
|
||||||
|
public class CoverViewDemoModel
|
||||||
|
{
|
||||||
|
public string ImgPath { get; set; }
|
||||||
|
|
||||||
|
public string BackgroundToken { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,6 +84,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Data\Model\ChatInfoModel.cs" />
|
<Compile Include="Data\Model\ChatInfoModel.cs" />
|
||||||
<Compile Include="Data\Model\ContributorModel.cs" />
|
<Compile Include="Data\Model\ContributorModel.cs" />
|
||||||
|
<Compile Include="Data\Model\CoverViewDemoModel.cs" />
|
||||||
<Compile Include="Data\Model\DemoDataModel.cs" />
|
<Compile Include="Data\Model\DemoDataModel.cs" />
|
||||||
<Compile Include="Data\Model\StepBarDemoModel.cs" />
|
<Compile Include="Data\Model\StepBarDemoModel.cs" />
|
||||||
<Compile Include="Properties\Langs\Lang.Designer.cs">
|
<Compile Include="Properties\Langs\Lang.Designer.cs">
|
||||||
@@ -97,6 +98,7 @@
|
|||||||
<DependentUpon>Lang.en.resx</DependentUpon>
|
<DependentUpon>Lang.en.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Service\DataService.cs" />
|
<Compile Include="Service\DataService.cs" />
|
||||||
|
<Compile Include="Tools\Converter\String2BrushConverter.cs" />
|
||||||
<Compile Include="Tools\Helper\AssemblyHelper.cs" />
|
<Compile Include="Tools\Helper\AssemblyHelper.cs" />
|
||||||
<Compile Include="Tools\Helper\CommonHelper.cs" />
|
<Compile Include="Tools\Helper\CommonHelper.cs" />
|
||||||
<Compile Include="Tools\Converter\StringRepeatConverter.cs" />
|
<Compile Include="Tools\Converter\StringRepeatConverter.cs" />
|
||||||
@@ -313,6 +315,8 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
||||||
|
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
|
||||||
|
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
|
||||||
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\ImageBrowserDemoViewModel.cs" />
|
<Compile Include="ViewModel\Controls\ImageBrowserDemoViewModel.cs" />
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
xmlns:converter="clr-namespace:HandyControlDemo.Tools.Converter">
|
xmlns:converter="clr-namespace:HandyControlDemo.Tools.Converter">
|
||||||
|
|
||||||
<converter:StringRepeatConverter x:Key="StringRepeatConverter"/>
|
<converter:StringRepeatConverter x:Key="StringRepeatConverter"/>
|
||||||
|
<converter:String2BrushConverter x:Key="String2BrushConverter"/>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using HandyControl.Data;
|
||||||
using HandyControlDemo.Data;
|
using HandyControlDemo.Data;
|
||||||
using HandyControlDemo.Tools.Converter;
|
using HandyControlDemo.Tools.Converter;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -125,5 +127,62 @@ namespace HandyControlDemo.Service
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal ObservableCollection<CoverViewDemoModel> GetCoverViewDemoDataList()
|
||||||
|
{
|
||||||
|
return new ObservableCollection<CoverViewDemoModel>
|
||||||
|
{
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/1.jpg",
|
||||||
|
BackgroundToken = ResourceToken.SuccessBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/2.jpg",
|
||||||
|
BackgroundToken = ResourceToken.PrimaryBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/3.jpg",
|
||||||
|
BackgroundToken = ResourceToken.WarningBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/4.jpg",
|
||||||
|
BackgroundToken = ResourceToken.DangerBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/5.jpg",
|
||||||
|
BackgroundToken = ResourceToken.SuccessBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/6.jpg",
|
||||||
|
BackgroundToken = ResourceToken.PrimaryBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/7.jpg",
|
||||||
|
BackgroundToken = ResourceToken.InfoBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/8.jpg",
|
||||||
|
BackgroundToken = ResourceToken.WarningBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/9.jpg",
|
||||||
|
BackgroundToken = ResourceToken.PrimaryBrush
|
||||||
|
},
|
||||||
|
new CoverViewDemoModel
|
||||||
|
{
|
||||||
|
ImgPath = "/HandyControlDemo;component/Resources/Img/Album/10.jpg",
|
||||||
|
BackgroundToken = ResourceToken.DangerBrush
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using HandyControl.Tools;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.Tools.Converter
|
||||||
|
{
|
||||||
|
public class String2BrushConverter : IValueConverter
|
||||||
|
{
|
||||||
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
return value is string str ? ResourceHelper.GetResource<Brush>(str) : default(Brush);
|
||||||
|
}
|
||||||
|
|
||||||
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,89 +3,22 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||||
|
DataContext="{Binding CoverView,Source={StaticResource Locator}}"
|
||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<controls:TransitioningContentControl>
|
<controls:TransitioningContentControl>
|
||||||
<controls:CoverView Margin="27" Width="880" Height="432" ItemWidth="160" ItemHeight="160">
|
<controls:CoverView Margin="27" Width="880" Height="432" ItemWidth="160" ItemHeight="160" ItemsSource="{Binding DataList}">
|
||||||
<controls:CoverViewItem>
|
<controls:CoverView.ItemHeaderTemplate>
|
||||||
<controls:CoverViewItem.Header>
|
<DataTemplate>
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/1.jpg"/>
|
<Image Source="{Binding ImgPath}"/>
|
||||||
</controls:CoverViewItem.Header>
|
</DataTemplate>
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource SuccessBrush}">
|
</controls:CoverView.ItemHeaderTemplate>
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
<controls:CoverView.ItemTemplate>
|
||||||
</Border>
|
<DataTemplate>
|
||||||
</controls:CoverViewItem>
|
<Border Margin="10" Height="300" Background="{Binding BackgroundToken,Converter={StaticResource String2BrushConverter}}">
|
||||||
<controls:CoverViewItem>
|
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
||||||
<controls:CoverViewItem.Header>
|
</Border>
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/2.jpg"/>
|
</DataTemplate>
|
||||||
</controls:CoverViewItem.Header>
|
</controls:CoverView.ItemTemplate>
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource PrimaryBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/3.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource WarningBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/4.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource DangerBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/5.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource SuccessBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/6.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource PrimaryBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/7.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource InfoBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/8.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource WarningBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/9.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource PrimaryBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem>
|
|
||||||
<controls:CoverViewItem.Header>
|
|
||||||
<Image Source="/HandyControlDemo;component/Resources/Img/Album/10.jpg"/>
|
|
||||||
</controls:CoverViewItem.Header>
|
|
||||||
<Border Margin="10" Height="300" Background="{DynamicResource DangerBrush}">
|
|
||||||
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
|
|
||||||
</Border>
|
|
||||||
</controls:CoverViewItem>
|
|
||||||
</controls:CoverView>
|
</controls:CoverView>
|
||||||
</controls:TransitioningContentControl>
|
</controls:TransitioningContentControl>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,25 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using HandyControlDemo.Service;
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
using HandyControlDemo.Service;
|
|
||||||
|
|
||||||
namespace HandyControlDemo.ViewModel
|
namespace HandyControlDemo.ViewModel
|
||||||
{
|
{
|
||||||
public class ComboBoxDemoViewModel : ViewModelBase
|
public class ComboBoxDemoViewModel : DemoViewModelBase<string>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
private List<string> _dataList;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
public List<string> DataList
|
|
||||||
{
|
|
||||||
get => _dataList;
|
|
||||||
set => Set(nameof(DataList), ref _dataList, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ComboBoxDemoViewModel(DataService dataService) => DataList = dataService.GetComboBoxDemoDataList();
|
public ComboBoxDemoViewModel(DataService dataService) => DataList = dataService.GetComboBoxDemoDataList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using HandyControlDemo.Data;
|
||||||
|
using HandyControlDemo.Service;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.ViewModel
|
||||||
|
{
|
||||||
|
public class CoverViewModel : DemoViewModelBase<CoverViewDemoModel>
|
||||||
|
{
|
||||||
|
public CoverViewModel(DataService dataService) => DataList = dataService.GetCoverViewDemoDataList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
using GalaSoft.MvvmLight.Command;
|
using GalaSoft.MvvmLight.Command;
|
||||||
using HandyControl.Data;
|
using HandyControl.Data;
|
||||||
using HandyControlDemo.Data;
|
using HandyControlDemo.Data;
|
||||||
@@ -8,27 +7,13 @@ using HandyControlDemo.Service;
|
|||||||
|
|
||||||
namespace HandyControlDemo.ViewModel
|
namespace HandyControlDemo.ViewModel
|
||||||
{
|
{
|
||||||
public class PaginationDemoViewModel : ViewModelBase
|
public class PaginationDemoViewModel : DemoViewModelBase<DemoDataModel>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所有数据
|
/// 所有数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly List<DemoDataModel> _totalDataList;
|
private readonly List<DemoDataModel> _totalDataList;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 显示的数据
|
|
||||||
/// </summary>
|
|
||||||
private List<DemoDataModel> _dataList;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 显示的数据
|
|
||||||
/// </summary>
|
|
||||||
public List<DemoDataModel> DataList
|
|
||||||
{
|
|
||||||
get => _dataList;
|
|
||||||
set => Set(nameof(DataList), ref _dataList, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 页码
|
/// 页码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Linq;
|
||||||
using System.Linq;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
using GalaSoft.MvvmLight.Command;
|
using GalaSoft.MvvmLight.Command;
|
||||||
using HandyControl.Controls;
|
using HandyControl.Controls;
|
||||||
using HandyControlDemo.Data;
|
using HandyControlDemo.Data;
|
||||||
@@ -9,26 +7,9 @@ using HandyControlDemo.Service;
|
|||||||
|
|
||||||
namespace HandyControlDemo.ViewModel
|
namespace HandyControlDemo.ViewModel
|
||||||
{
|
{
|
||||||
public class StepBarDemoViewModel : ViewModelBase
|
public class StepBarDemoViewModel : DemoViewModelBase<StepBarDemoModel>
|
||||||
{
|
{
|
||||||
/// <summary>
|
public StepBarDemoViewModel(DataService dataService) => DataList = dataService.GetStepBarDemoDataList();
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
private List<StepBarDemoModel> _dataList;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
public List<StepBarDemoModel> DataList
|
|
||||||
{
|
|
||||||
get => _dataList;
|
|
||||||
set => Set(nameof(DataList), ref _dataList, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public StepBarDemoViewModel(DataService dataService)
|
|
||||||
{
|
|
||||||
DataList = dataService.GetStepBarDemoDataList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private RelayCommand<Panel> _nextCmd;
|
private RelayCommand<Panel> _nextCmd;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using GalaSoft.MvvmLight;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.ViewModel
|
||||||
|
{
|
||||||
|
public class DemoViewModelBase<T> : ViewModelBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 数据列表
|
||||||
|
/// </summary>
|
||||||
|
private IList<T> _dataList;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据列表
|
||||||
|
/// </summary>
|
||||||
|
public IList<T> DataList
|
||||||
|
{
|
||||||
|
get => _dataList;
|
||||||
|
set => Set(nameof(DataList), ref _dataList, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,27 +1,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Threading;
|
||||||
using System.Threading;
|
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
using HandyControlDemo.Data;
|
using HandyControlDemo.Data;
|
||||||
using HandyControlDemo.Service;
|
using HandyControlDemo.Service;
|
||||||
|
|
||||||
namespace HandyControlDemo.ViewModel
|
namespace HandyControlDemo.ViewModel
|
||||||
{
|
{
|
||||||
public class ContributorsViewModel : ViewModelBase
|
public class ContributorsViewModel : DemoViewModelBase<ContributorModel>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
private List<ContributorModel> _dataList;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
public List<ContributorModel> DataList
|
|
||||||
{
|
|
||||||
get => _dataList;
|
|
||||||
set => Set(nameof(DataList), ref _dataList, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContributorsViewModel(DataService dataService)
|
public ContributorsViewModel(DataService dataService)
|
||||||
{
|
{
|
||||||
ThreadPool.QueueUserWorkItem(state =>
|
ThreadPool.QueueUserWorkItem(state =>
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using GalaSoft.MvvmLight;
|
|
||||||
using GalaSoft.MvvmLight.Command;
|
using GalaSoft.MvvmLight.Command;
|
||||||
using GalaSoft.MvvmLight.Messaging;
|
using GalaSoft.MvvmLight.Messaging;
|
||||||
using HandyControlDemo.Data;
|
using HandyControlDemo.Data;
|
||||||
@@ -10,7 +8,7 @@ using HandyControlDemo.Tools;
|
|||||||
|
|
||||||
namespace HandyControlDemo.ViewModel
|
namespace HandyControlDemo.ViewModel
|
||||||
{
|
{
|
||||||
public class MainViewModel : ViewModelBase
|
public class MainViewModel : DemoViewModelBase<DemoDataModel>
|
||||||
{
|
{
|
||||||
#region 字段
|
#region 字段
|
||||||
|
|
||||||
@@ -24,11 +22,6 @@ namespace HandyControlDemo.ViewModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private object _subContent;
|
private object _subContent;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
private List<DemoDataModel> _dataList;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前选中的列表项
|
/// 当前选中的列表项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -57,15 +50,6 @@ namespace HandyControlDemo.ViewModel
|
|||||||
|
|
||||||
#region 属性
|
#region 属性
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 数据列表
|
|
||||||
/// </summary>
|
|
||||||
public List<DemoDataModel> DataList
|
|
||||||
{
|
|
||||||
get => _dataList;
|
|
||||||
set => Set(nameof(DataList), ref _dataList, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子内容
|
/// 子内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace HandyControlDemo.ViewModel
|
|||||||
SimpleIoc.Default.Register<StepBarDemoViewModel>();
|
SimpleIoc.Default.Register<StepBarDemoViewModel>();
|
||||||
SimpleIoc.Default.Register<PaginationDemoViewModel>();
|
SimpleIoc.Default.Register<PaginationDemoViewModel>();
|
||||||
SimpleIoc.Default.Register<ChatBoxViewModel>();
|
SimpleIoc.Default.Register<ChatBoxViewModel>();
|
||||||
|
SimpleIoc.Default.Register<CoverViewModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||||
@@ -48,6 +49,8 @@ namespace HandyControlDemo.ViewModel
|
|||||||
|
|
||||||
public ChatBoxViewModel ChatBox => new ChatBoxViewModel();
|
public ChatBoxViewModel ChatBox => new ChatBoxViewModel();
|
||||||
|
|
||||||
|
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,5 +12,14 @@ namespace HandyControl.Controls
|
|||||||
get => GetValue(HeaderProperty);
|
get => GetValue(HeaderProperty);
|
||||||
set => SetValue(HeaderProperty, value);
|
set => SetValue(HeaderProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty HeaderTemplateProperty = DependencyProperty.Register(
|
||||||
|
"HeaderTemplate", typeof(DataTemplate), typeof(HeaderedSelectableItem), new PropertyMetadata(default(DataTemplate)));
|
||||||
|
|
||||||
|
public DataTemplate HeaderTemplate
|
||||||
|
{
|
||||||
|
get => (DataTemplate)GetValue(HeaderTemplateProperty);
|
||||||
|
set => SetValue(HeaderTemplateProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using HandyControl.Data;
|
using HandyControl.Data;
|
||||||
using HandyControl.Tools;
|
using HandyControl.Tools;
|
||||||
@@ -11,6 +14,10 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
private CoverViewItem _selectedItem;
|
private CoverViewItem _selectedItem;
|
||||||
|
|
||||||
|
private IEnumerable _itemsSourceInternal;
|
||||||
|
|
||||||
|
private readonly Dictionary<object, CoverViewItem> _entryDic = new Dictionary<object, CoverViewItem>();
|
||||||
|
|
||||||
public CoverView()
|
public CoverView()
|
||||||
{
|
{
|
||||||
_viewContent = new CoverViewContent();
|
_viewContent = new CoverViewContent();
|
||||||
@@ -31,6 +38,7 @@ namespace HandyControl.Controls
|
|||||||
if (_viewContent != null)
|
if (_viewContent != null)
|
||||||
{
|
{
|
||||||
_viewContent.Content = item.Content;
|
_viewContent.Content = item.Content;
|
||||||
|
_viewContent.ContentTemplate = ItemTemplate;
|
||||||
UpdateCoverViewContent(true);
|
UpdateCoverViewContent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,6 +62,7 @@ namespace HandyControl.Controls
|
|||||||
if (_viewContent != null)
|
if (_viewContent != null)
|
||||||
{
|
{
|
||||||
_viewContent.Content = null;
|
_viewContent.Content = null;
|
||||||
|
_viewContent.ContentTemplate = null;
|
||||||
UpdateCoverViewContent(false);
|
UpdateCoverViewContent(false);
|
||||||
}
|
}
|
||||||
_selectedItem.IsSelected = false;
|
_selectedItem.IsSelected = false;
|
||||||
@@ -78,6 +87,14 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
protected override DependencyObject GetContainerForItemOverride() => new CoverViewItem();
|
protected override DependencyObject GetContainerForItemOverride() => new CoverViewItem();
|
||||||
|
|
||||||
|
private void SetBindingForItem(FrameworkElement item)
|
||||||
|
{
|
||||||
|
item.SetBinding(MarginProperty, new Binding(ItemMarginProperty.Name) { Source = this });
|
||||||
|
item.SetBinding(WidthProperty, new Binding(ItemWidthProperty.Name) { Source = this });
|
||||||
|
item.SetBinding(HeightProperty, new Binding(ItemHeightProperty.Name) { Source = this });
|
||||||
|
item.SetBinding(HeaderedSelectableItem.HeaderTemplateProperty, new Binding(ItemHeaderTemplateProperty.Name) { Source = this });
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is CoverViewItem;
|
protected override bool IsItemItsOwnContainerOverride(object item) => item is CoverViewItem;
|
||||||
|
|
||||||
public static readonly DependencyProperty CoverViewContentStyleProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty CoverViewContentStyleProperty = DependencyProperty.Register(
|
||||||
@@ -133,6 +150,15 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(ItemContentHeightFixedProperty, value);
|
set => SetValue(ItemContentHeightFixedProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty ItemHeaderTemplateProperty = DependencyProperty.Register(
|
||||||
|
"ItemHeaderTemplate", typeof(DataTemplate), typeof(CoverView), new PropertyMetadata(default(DataTemplate)));
|
||||||
|
|
||||||
|
public DataTemplate ItemHeaderTemplate
|
||||||
|
{
|
||||||
|
get => (DataTemplate)GetValue(ItemHeaderTemplateProperty);
|
||||||
|
set => SetValue(ItemHeaderTemplateProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
||||||
{
|
{
|
||||||
base.OnRenderSizeChanged(sizeInfo);
|
base.OnRenderSizeChanged(sizeInfo);
|
||||||
@@ -144,28 +170,16 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (ItemsHost == null) return;
|
if (ItemsHost == null) return;
|
||||||
|
|
||||||
ItemsHost.Children.Clear();
|
_entryDic.Clear();
|
||||||
var index = 0;
|
|
||||||
foreach (var item in Items)
|
foreach (var item in Items)
|
||||||
{
|
{
|
||||||
DependencyObject container;
|
AddItem(item);
|
||||||
if (IsItemItsOwnContainerOverride(item))
|
|
||||||
{
|
|
||||||
container = item as DependencyObject;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
container = GetContainerForItemOverride();
|
|
||||||
PrepareContainerForItemOverride(container, item);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (container is CoverViewItem element)
|
|
||||||
{
|
|
||||||
element.Index = index++;
|
|
||||||
element.Style = ItemContainerStyle;
|
|
||||||
ItemsHost.Children.Add(element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GenerateIndex();
|
||||||
|
|
||||||
|
UpdateCoverViewContent(_viewContent.IsOpen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -188,6 +202,18 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateCoverViewContentPosition();
|
||||||
|
if (_viewContent.CanSwitch)
|
||||||
|
{
|
||||||
|
_viewContent.IsOpen = isOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新内容视图位置
|
||||||
|
/// </summary>
|
||||||
|
private void UpdateCoverViewContentPosition()
|
||||||
|
{
|
||||||
var total = Items.Count + 1;
|
var total = Items.Count + 1;
|
||||||
var totalRow = total / Groups + (total % Groups > 0 ? 1 : 0);
|
var totalRow = total / Groups + (total % Groups > 0 ? 1 : 0);
|
||||||
if (total <= Groups)
|
if (total <= Groups)
|
||||||
@@ -208,10 +234,170 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
_viewContent.UpdatePosition(_selectedItem.Index, Groups, _selectedItem.DesiredSize.Width);
|
_viewContent.UpdatePosition(_selectedItem.Index, Groups, _selectedItem.DesiredSize.Width);
|
||||||
if (_viewContent.CanSwitch)
|
}
|
||||||
|
|
||||||
|
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
|
||||||
|
{
|
||||||
|
if (_itemsSourceInternal != null)
|
||||||
{
|
{
|
||||||
_viewContent.IsOpen = isOpen;
|
if (_itemsSourceInternal is INotifyCollectionChanged s)
|
||||||
|
{
|
||||||
|
s.CollectionChanged -= InternalCollectionChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearItems();
|
||||||
}
|
}
|
||||||
|
_itemsSourceInternal = newValue;
|
||||||
|
if (_itemsSourceInternal != null)
|
||||||
|
{
|
||||||
|
if (_itemsSourceInternal is INotifyCollectionChanged s)
|
||||||
|
{
|
||||||
|
s.CollectionChanged += InternalCollectionChanged;
|
||||||
|
}
|
||||||
|
foreach (var item in _itemsSourceInternal)
|
||||||
|
{
|
||||||
|
AddItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ItemsHost != null)
|
||||||
|
{
|
||||||
|
GenerateIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearItems()
|
||||||
|
{
|
||||||
|
_selectedItem = null;
|
||||||
|
if (_viewContent != null)
|
||||||
|
{
|
||||||
|
ItemsHost?.Children.Remove(_viewContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
_entryDic.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveItem(object item)
|
||||||
|
{
|
||||||
|
if (_entryDic.TryGetValue(item, out var entry))
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(entry, _selectedItem))
|
||||||
|
{
|
||||||
|
_selectedItem = null;
|
||||||
|
if (_viewContent != null)
|
||||||
|
{
|
||||||
|
_viewContent.Content = null;
|
||||||
|
_viewContent.IsOpen = false;
|
||||||
|
ItemsHost.Children.Remove(_viewContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemsHost.Children.Remove(entry);
|
||||||
|
Items.Remove(item);
|
||||||
|
_entryDic.Remove(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddItem(object item) => InsertItem(_entryDic.Count, item);
|
||||||
|
|
||||||
|
private void InsertItem(int index, object item)
|
||||||
|
{
|
||||||
|
if (ItemsHost == null)
|
||||||
|
{
|
||||||
|
Items.Insert(index, item);
|
||||||
|
_entryDic.Add(item, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DependencyObject container;
|
||||||
|
if (IsItemItsOwnContainerOverride(item))
|
||||||
|
{
|
||||||
|
container = item as DependencyObject;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
container = GetContainerForItemOverride();
|
||||||
|
PrepareContainerForItemOverride(container, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (container is CoverViewItem element)
|
||||||
|
{
|
||||||
|
SetBindingForItem(element);
|
||||||
|
element.Style = ItemContainerStyle;
|
||||||
|
if (element.Header == null)
|
||||||
|
{
|
||||||
|
element.Header = item;
|
||||||
|
}
|
||||||
|
_entryDic[item] = element;
|
||||||
|
ItemsHost.Children.Insert(index, element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成序号
|
||||||
|
/// </summary>
|
||||||
|
private void GenerateIndex()
|
||||||
|
{
|
||||||
|
var index = 0;
|
||||||
|
foreach (var item in Items)
|
||||||
|
{
|
||||||
|
_entryDic[item].Index = index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InternalCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (ItemsHost == null) return;
|
||||||
|
|
||||||
|
if (e.OldItems != null)
|
||||||
|
{
|
||||||
|
foreach (var item in e.OldItems)
|
||||||
|
{
|
||||||
|
RemoveItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (e.NewItems != null)
|
||||||
|
{
|
||||||
|
if (_viewContent.IsOpen)
|
||||||
|
{
|
||||||
|
ItemsHost.Children.Remove(_viewContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
foreach (var item in e.NewItems)
|
||||||
|
{
|
||||||
|
var index = e.NewStartingIndex + count++;
|
||||||
|
InsertItem(index, item);
|
||||||
|
if (_itemsSourceInternal != null)
|
||||||
|
{
|
||||||
|
Items.Insert(index, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GenerateIndex();
|
||||||
|
if (_viewContent.IsOpen)
|
||||||
|
{
|
||||||
|
UpdateCoverViewContentPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnItemsChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (_itemsSourceInternal != null) return;
|
||||||
|
|
||||||
|
InternalCollectionChanged(sender, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnItemTemplateChanged(DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnItemContainerStyleChanged(DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<ColumnDefinition Width="12" Name="Definition1"/>
|
<ColumnDefinition Width="12" Name="Definition1"/>
|
||||||
<ColumnDefinition Name="Definition2"/>
|
<ColumnDefinition Name="Definition2"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Ellipse Name="Dot" VerticalAlignment="Top" Fill="{DynamicResource DangerBrush}" Width="6" Height="6" Visibility="{TemplateBinding IsRead,Converter={StaticResource Boolean2BooleanReConverter}}" Margin="0,0,6,0"/>
|
<Ellipse Name="Dot" VerticalAlignment="Top" Fill="{DynamicResource DangerBrush}" Width="6" Height="6" Visibility="{TemplateBinding IsRead,Converter={StaticResource Boolean2VisibilityReConverter}}" Margin="0,0,6,0"/>
|
||||||
<Path Name="Tail" Grid.Column="1" Data="{StaticResource BubbleTailGeometry}" Fill="{TemplateBinding Background}" HorizontalAlignment="Right" Stretch="Uniform" VerticalAlignment="Bottom" Width="15" Height="15" RenderTransformOrigin="0.5,0.5"/>
|
<Path Name="Tail" Grid.Column="1" Data="{StaticResource BubbleTailGeometry}" Fill="{TemplateBinding Background}" HorizontalAlignment="Right" Stretch="Uniform" VerticalAlignment="Bottom" Width="15" Height="15" RenderTransformOrigin="0.5,0.5"/>
|
||||||
<Border Name="Body" Grid.Column="1" Background="{TemplateBinding Background}" CornerRadius="15" Margin="0,0,3,0">
|
<Border Name="Body" Grid.Column="1" Background="{TemplateBinding Background}" CornerRadius="15" Margin="0,0,3,0">
|
||||||
<Grid VerticalAlignment="Center" Margin="{TemplateBinding Padding}">
|
<Grid VerticalAlignment="Center" Margin="{TemplateBinding Padding}">
|
||||||
|
|||||||
@@ -3,14 +3,11 @@
|
|||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
<Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem">
|
<Style x:Key="CoverViewItemBaseStyle" TargetType="controls:CoverViewItem">
|
||||||
<Setter Property="Margin" Value="{Binding ItemMargin,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
|
||||||
<Setter Property="Width" Value="{Binding ItemWidth,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
|
||||||
<Setter Property="Height" Value="{Binding ItemHeight,RelativeSource={RelativeSource AncestorType=controls:CoverView}}"/>
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="controls:CoverViewItem">
|
<ControlTemplate TargetType="controls:CoverViewItem">
|
||||||
<Border BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
|
<Border BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||||
<ContentPresenter ContentSource="Header" Margin="{TemplateBinding Padding}"/>
|
<ContentPresenter ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="{TemplateBinding Padding}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
|
|||||||
@@ -265,15 +265,6 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
<!--<Style.Triggers>
|
|
||||||
<MultiTrigger>
|
|
||||||
<MultiTrigger.Conditions>
|
|
||||||
<Condition Property="IsGrouping" Value="true"/>
|
|
||||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
|
|
||||||
</MultiTrigger.Conditions>
|
|
||||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
|
||||||
</MultiTrigger>
|
|
||||||
</Style.Triggers>-->
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
Reference in new issue
Block a user