なろうブックマーク分析用ツールのPrism+WinUI3サンプル実装
Revision | 69b55ccea7f8941e14a85f5f47a06f432bae9ff9 (tree) |
---|---|
Time | 2022-08-16 21:32:07 |
Author | yoshy <yoshy.org.bitbucket@gz.j...> |
Commiter | yoshy |
[ADD] 列ソートを除くデータグリッドの残機能を実装(全データ列、ツールチップ、ダブルタップイベント)
@@ -27,6 +27,7 @@ namespace TestNarou3.Adaptor.Boundary.Gateway.ViewModel.Child | ||
27 | 27 | ReadOnlyReactiveProperty<string> GeneralFirstUp { get; } |
28 | 28 | ReadOnlyReactiveProperty<string> GeneralLastUp { get; } |
29 | 29 | ReadOnlyReactiveProperty<string> NovelUpdatedAt { get; } |
30 | + | |
30 | 31 | IBookmarkDetailListViewModel Parent { get; } |
31 | 32 | BookmarkDetailListRow Source { get; } |
32 | 33 | } |
@@ -60,13 +60,13 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel | ||
60 | 60 | |
61 | 61 | private void OpenBookmark() |
62 | 62 | { |
63 | + logger.Trace("OpenBookmark: {0}", this.selectedRow?.NCode ?? "item not selected"); | |
64 | + | |
63 | 65 | if (this.selectedRow == null) |
64 | 66 | { |
65 | 67 | return; |
66 | 68 | } |
67 | 69 | |
68 | - logger.Trace("OpenBookmark: {0}", this.selectedRow.NCode); | |
69 | - | |
70 | 70 | // TODO Service |
71 | 71 | |
72 | 72 | string url = "https://ncode.syosetu.com/" + this.selectedRow.NCode.ToLower(); |
@@ -112,52 +112,5 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel | ||
112 | 112 | this.disposables.Dispose(); |
113 | 113 | } |
114 | 114 | |
115 | - #region INavigationAware | |
116 | - | |
117 | -#if false | |
118 | - public bool IsNavigationTarget(NavigationContext ctx) | |
119 | - { | |
120 | - int categoryNo = GetCategoryNoFromNavigationContext(ctx); | |
121 | - | |
122 | - //logger.Trace("IsNavigationTarget: to:{0} <> this:{1}", categoryNo, this.CategoryNo); | |
123 | - | |
124 | - if (this.CategoryNo == -1 && !WindowController.ContainsCategoryNo(categoryNo)) | |
125 | - { | |
126 | - //logger.Trace("IsNavigationTarget: new Category"); | |
127 | - return true; | |
128 | - } | |
129 | - | |
130 | - bool isTarget = categoryNo == this.CategoryNo; | |
131 | - | |
132 | - //logger.Trace("IsNavigationTarget: isTarget {0}", isTarget); | |
133 | - | |
134 | - return isTarget; | |
135 | - } | |
136 | - | |
137 | - public void OnNavigatedTo(NavigationContext ctx) | |
138 | - { | |
139 | - int categoryNo = GetCategoryNoFromNavigationContext(ctx); | |
140 | - | |
141 | - //logger.Trace("OnNavigatedTo: to:{0} -> this:{1}", categoryNo, this.CategoryNo); | |
142 | - | |
143 | - if (this.CategoryNo == -1) | |
144 | - { | |
145 | - this.CategoryNo = categoryNo; | |
146 | - this.WindowController.RegisterDetailList(this.CategoryNo, this); | |
147 | - } | |
148 | - } | |
149 | - | |
150 | - public void OnNavigatedFrom(NavigationContext ctx) | |
151 | - { | |
152 | - // NOP | |
153 | - } | |
154 | - | |
155 | - private static int GetCategoryNoFromNavigationContext(NavigationContext ctx) | |
156 | - { | |
157 | - return ctx.Parameters.GetValue<int>(IBookmarkDetailListViewModel.CATEGORY_NO_KEY); | |
158 | - } | |
159 | -#endif | |
160 | - | |
161 | -#endregion | |
162 | 115 | } |
163 | 116 | } |
@@ -29,9 +29,6 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel.Child | ||
29 | 29 | d.AllPoint.AddTo(d.disposables); |
30 | 30 | d.AllHyokaCnt.AddTo(d.disposables); |
31 | 31 | d.NovelUpdatedAt.AddTo(d.disposables); |
32 | - | |
33 | - //d.IsSelected.AddTo(d.disposables); | |
34 | - //d.IsSelected.Subscribe(d.OnSelectedItemChanged).AddTo(d.disposables); | |
35 | 32 | } |
36 | 33 | } |
37 | 34 | } |
@@ -1,5 +1,5 @@ | ||
1 | -using Reactive.Bindings; | |
2 | -using System; | |
1 | +using NLog; | |
2 | +using Reactive.Bindings; | |
3 | 3 | using System.Reactive.Disposables; |
4 | 4 | using TestNarou3.Adaptor.Boundary.Gateway.ViewModel; |
5 | 5 | using TestNarou3.Adaptor.Boundary.Gateway.ViewModel.Child; |
@@ -10,6 +10,8 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel.Child | ||
10 | 10 | internal partial record class BookmarkDetailListRowViewModel |
11 | 11 | : IBookmarkDetailListRowViewModel, IDisposable |
12 | 12 | { |
13 | + private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); | |
14 | + | |
13 | 15 | public string NCode { get; private set; } |
14 | 16 | public ReadOnlyReactiveProperty<string> Summary { get; private set; } |
15 | 17 | public ReadOnlyReactiveProperty<string> Title { get; private set; } |
@@ -33,7 +35,7 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel.Child | ||
33 | 35 | public ReadOnlyReactiveProperty<string> GeneralFirstUp { get; private set; } |
34 | 36 | public ReadOnlyReactiveProperty<string> GeneralLastUp { get; private set; } |
35 | 37 | public ReadOnlyReactiveProperty<string> NovelUpdatedAt { get; private set; } |
36 | - //public ReactiveProperty<bool> IsSelected { get; private set; } | |
38 | + | |
37 | 39 | public IBookmarkDetailListViewModel Parent { get; private set; } |
38 | 40 | public BookmarkDetailListRow Source { get; private set; } |
39 | 41 |
@@ -47,18 +49,6 @@ namespace TestNarou3.Adaptor.Gateway.ViewModel.Child | ||
47 | 49 | this.Parent = parent; |
48 | 50 | } |
49 | 51 | |
50 | -#if false | |
51 | - private void OnSelectedItemChanged(bool isSelected) | |
52 | - { | |
53 | - if (!isSelected) | |
54 | - { | |
55 | - return; | |
56 | - } | |
57 | - | |
58 | - this.Parent.NotifySelectedItemChanged(this); | |
59 | - } | |
60 | -#endif | |
61 | - | |
62 | 52 | protected virtual void Dispose(bool disposing) |
63 | 53 | { |
64 | 54 | if (!disposedValue) |
@@ -18,6 +18,7 @@ | ||
18 | 18 | </ItemGroup> |
19 | 19 | <ItemGroup> |
20 | 20 | <PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" /> |
21 | + <PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.8" /> | |
21 | 22 | </ItemGroup> |
22 | 23 | <ItemGroup> |
23 | 24 | <ProjectReference Include="..\TestNarou3.Adaptor\TestNarou3.30Adaptor.csproj" /> |
@@ -9,7 +9,7 @@ | ||
9 | 9 | mc:Ignorable="d"> |
10 | 10 | |
11 | 11 | <ListView ItemsSource="{x:Bind ViewModel.Rows, Mode=OneWay}" |
12 | - SelectedItem="{x:Bind ViewModel.SelectedItem.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" | |
12 | + SelectedItem="{x:Bind ViewModel.SelectedItem.Value, Mode=TwoWay}" | |
13 | 13 | SelectionMode="Single"> |
14 | 14 | |
15 | 15 | <!-- |
@@ -20,6 +20,12 @@ | ||
20 | 20 | </ListView.Resources> |
21 | 21 | --> |
22 | 22 | |
23 | + <ListView.HeaderTemplate> | |
24 | + <DataTemplate> | |
25 | + <TextBlock Text="ブックマークカテゴリ" FontSize="24" FontWeight="Bold" /> | |
26 | + </DataTemplate> | |
27 | + </ListView.HeaderTemplate> | |
28 | + | |
23 | 29 | <ListView.ItemTemplate> |
24 | 30 | <DataTemplate> |
25 | 31 | <Grid Padding="10"> |
@@ -7,292 +7,267 @@ | ||
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
8 | 8 | xmlns:ctc="using:CommunityToolkit.WinUI.UI.Controls" |
9 | 9 | xmlns:ctPrim="using:CommunityToolkit.WinUI.UI.Controls.Primitives" |
10 | + xmlns:i="using:Microsoft.Xaml.Interactivity" | |
11 | + xmlns:ia="using:Microsoft.Xaml.Interactions.Core" | |
12 | + xmlns:conv="using:CleanAuLait.Prism.WinUI3.OuterEdge.UI.Xaml.Converter" | |
13 | + xmlns:vm="using:TestNarou3.Adaptor.Boundary.Gateway.ViewModel.Child" | |
10 | 14 | mc:Ignorable="d"> |
11 | 15 | |
12 | - <!-- | |
13 | - <ListView ItemsSource="{x:Bind ViewModel.Rows, Mode=OneWay}" | |
14 | - SelectedItem="{x:Bind ViewModel.SelectedItem.Value, Mode=TwoWay}" | |
15 | - SelectionMode="Single"> | |
16 | - | |
17 | - <ListView.ItemTemplate> | |
18 | - <DataTemplate> | |
19 | - <Grid Padding="10"> | |
20 | - <Grid.RowDefinitions> | |
21 | - <RowDefinition Height="auto"/> | |
22 | - <RowDefinition Height="auto"/> | |
23 | - </Grid.RowDefinitions> | |
24 | - <TextBlock Grid.Row="0" FontSize="24" FontWeight="Bold" | |
25 | - Text="{Binding Title.Value}" TextWrapping="Wrap" /> | |
26 | - <StackPanel Grid.Row="1" Orientation="Horizontal"> | |
27 | - <TextBlock Text="作:"/> | |
28 | - <TextBlock Text="{Binding Writer.Value}"/> | |
29 | - <TextBlock Text="総合評価:" Padding="10,0,0,0"/> | |
30 | - <TextBlock Text="{Binding GlobalPoint.Value}"/> | |
31 | - </StackPanel> | |
32 | - </Grid> | |
33 | - | |
34 | - </DataTemplate> | |
35 | - </ListView.ItemTemplate> | |
36 | - | |
37 | - </ListView> | |
38 | - --> | |
16 | + <UserControl.Resources> | |
17 | + <conv:StringFormatConverter x:Key="StringFormat" /> | |
18 | + </UserControl.Resources> | |
39 | 19 | |
40 | 20 | <ctc:DataGrid ItemsSource="{x:Bind ViewModel.Rows, Mode=OneWay}" |
41 | 21 | AutoGenerateColumns="False" |
22 | + CanUserReorderColumns="False" | |
23 | + CanUserSortColumns="True" | |
42 | 24 | SelectionMode="Single" |
25 | + SelectedItem="{x:Bind ViewModel.SelectedItem.Value, Mode=TwoWay}" | |
43 | 26 | IsReadOnly="True" |
27 | + RowBackground="{ThemeResource SystemControlBackgroundAltMediumLowBrush}" | |
28 | + AlternatingRowBackground="{ThemeResource SystemControlBackgroundAltMediumHighBrush}" | |
44 | 29 | GridLinesVisibility="None"> |
45 | 30 | |
31 | + <i:Interaction.Behaviors> | |
32 | + <ia:EventTriggerBehavior EventName="DoubleTapped"> | |
33 | + <ia:EventTriggerBehavior.Actions> | |
34 | + <ia:InvokeCommandAction Command="{x:Bind ViewModel.CommandOpenBookmark}" /> | |
35 | + </ia:EventTriggerBehavior.Actions> | |
36 | + </ia:EventTriggerBehavior> | |
37 | + </i:Interaction.Behaviors> | |
38 | + | |
39 | + <!-- | |
46 | 40 | <ctc:DataGrid.ColumnHeaderStyle> |
47 | 41 | <Style TargetType="ctPrim:DataGridColumnHeader"> |
48 | 42 | <Setter Property="HorizontalAlignment" Value="Stretch"/> |
49 | - <Setter Property="HorizontalContentAlignment" Value="Center"/> | |
50 | - <Setter Property="Background" Value="{x:Null}"/> | |
43 | + <Setter Property="HorizontalContentAlignment" Value="Left"/> | |
51 | 44 | </Style> |
52 | 45 | </ctc:DataGrid.ColumnHeaderStyle> |
46 | + --> | |
53 | 47 | |
54 | 48 | <ctc:DataGrid.Columns> |
55 | 49 | |
56 | - <ctc:DataGridTextColumn Header="タイトル" Width="300" | |
57 | - Binding="{Binding Title.Value}"> | |
58 | - </ctc:DataGridTextColumn> | |
59 | - <ctc:DataGridTextColumn Header="作者" Width="100" | |
60 | - Binding="{Binding Writer.Value}"> | |
61 | - </ctc:DataGridTextColumn> | |
62 | - <ctc:DataGridTextColumn Header="完結" Width="40" | |
63 | - Binding="{Binding End.Value}"> | |
50 | + <ctc:DataGridTemplateColumn Header="概" Width="10"> | |
51 | + <ctc:DataGridTemplateColumn.CellTemplate> | |
52 | + <DataTemplate x:DataType="vm:IBookmarkDetailListRowViewModel"> | |
53 | + <Grid VerticalAlignment="Center"> | |
54 | + <TextBlock Text="●" ToolTipService.ToolTip="{x:Bind Summary.Value}" | |
55 | + HorizontalAlignment="Center" FontSize="20"/> | |
56 | + </Grid> | |
57 | + </DataTemplate> | |
58 | + </ctc:DataGridTemplateColumn.CellTemplate> | |
59 | + </ctc:DataGridTemplateColumn> | |
60 | + <ctc:DataGridTemplateColumn Header="タイトル" Width="300"> | |
61 | + <ctc:DataGridTemplateColumn.CellTemplate> | |
62 | + <DataTemplate x:DataType="vm:IBookmarkDetailListRowViewModel"> | |
63 | + <Grid VerticalAlignment="Center"> | |
64 | + <Grid.ColumnDefinitions> | |
65 | + <ColumnDefinition Width="*"/> | |
66 | + <ColumnDefinition Width="12"/> | |
67 | + </Grid.ColumnDefinitions> | |
68 | + <TextBlock Text="{x:Bind Title.Value}" ToolTipService.ToolTip="{x:Bind Title.Value}" /> | |
69 | + </Grid> | |
70 | + </DataTemplate> | |
71 | + </ctc:DataGridTemplateColumn.CellTemplate> | |
72 | + </ctc:DataGridTemplateColumn> | |
73 | + <ctc:DataGridTemplateColumn Header="作者" Width="100"> | |
74 | + <ctc:DataGridTemplateColumn.CellTemplate> | |
75 | + <DataTemplate x:DataType="vm:IBookmarkDetailListRowViewModel"> | |
76 | + <Grid VerticalAlignment="Center"> | |
77 | + <Grid.ColumnDefinitions> | |
78 | + <ColumnDefinition Width="*"/> | |
79 | + <ColumnDefinition Width="12"/> | |
80 | + </Grid.ColumnDefinitions> | |
81 | + <TextBlock Text="{x:Bind Writer.Value}" ToolTipService.ToolTip="{x:Bind Writer.Value}" /> | |
82 | + </Grid> | |
83 | + </DataTemplate> | |
84 | + </ctc:DataGridTemplateColumn.CellTemplate> | |
85 | + </ctc:DataGridTemplateColumn> | |
86 | + <ctc:DataGridTemplateColumn Header="完結" Width="40"> | |
87 | + <ctc:DataGridTemplateColumn.CellTemplate> | |
88 | + <DataTemplate x:DataType="vm:IBookmarkDetailListRowViewModel"> | |
89 | + <Grid VerticalAlignment="Center"> | |
90 | + <TextBlock Text="{x:Bind End.Value}" HorizontalAlignment="Center"/> | |
91 | + </Grid> | |
92 | + </DataTemplate> | |
93 | + </ctc:DataGridTemplateColumn.CellTemplate> | |
94 | + </ctc:DataGridTemplateColumn> | |
95 | + <ctc:DataGridTextColumn Header="話数" Width="60" | |
96 | + Binding="{Binding GeneralAllNo.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
64 | 97 | <ctc:DataGridTextColumn.ElementStyle> |
65 | - <Style TargetType="ctPrim:DataGridCellsPresenter"> | |
66 | - <Setter Property="HorizontalAlignment" Value="Center" /> | |
98 | + <Style TargetType="TextBlock"> | |
99 | + <Setter Property="HorizontalAlignment" Value="Right" /> | |
67 | 100 | </Style> |
68 | 101 | </ctc:DataGridTextColumn.ElementStyle> |
69 | 102 | </ctc:DataGridTextColumn> |
70 | - <ctc:DataGridTextColumn Header="話数" Width="60" | |
71 | - Binding="{Binding GeneralAllNo.Value}"> | |
72 | - </ctc:DataGridTextColumn> | |
73 | 103 | <ctc:DataGridTextColumn Header="長さ[h]" Width="70" |
74 | - Binding="{Binding Time.Value}"> | |
75 | - </ctc:DataGridTextColumn> | |
76 | - | |
77 | - </ctc:DataGrid.Columns> | |
78 | - | |
79 | - </ctc:DataGrid> | |
80 | - | |
81 | - <!-- | |
82 | - <DataGrid ItemsSource="{Binding Rows}" | |
83 | - AutoGenerateColumns="False" | |
84 | - CanUserAddRows="False" | |
85 | - CanUserDeleteRows="False" | |
86 | - CanUserResizeRows="False" | |
87 | - SelectionUnit="FullRow" | |
88 | - SelectionMode="Single" | |
89 | - IsReadOnly="True" | |
90 | - Padding="0,0,0,0" | |
91 | - RowHeaderWidth="0" | |
92 | - VirtualizingPanel.ScrollUnit="Pixel" | |
93 | - VerticalScrollBarVisibility="Visible" | |
94 | - GridLinesVisibility="None" | |
95 | - AlternatingRowBackground="AliceBlue" | |
96 | - Background="{x:Null}" | |
97 | - RowBackground="{x:Null}"> | |
98 | - | |
99 | - <DataGrid.InputBindings> | |
100 | - <MouseBinding MouseAction="LeftDoubleClick" Command="{Binding CommandOpenBookmark}" /> | |
101 | - </DataGrid.InputBindings> | |
102 | - | |
103 | - <DataGrid.RowStyle> | |
104 | - <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource {x:Type DataGridRow}}"> | |
105 | - <Setter Property="IsSelected" Value="{Binding IsSelected.Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> | |
106 | - </Style> | |
107 | - </DataGrid.RowStyle> | |
108 | - | |
109 | - <DataGrid.CellStyle> | |
110 | - <Style TargetType="DataGridCell"> | |
111 | - <Setter Property="BorderThickness" Value="0"/> | |
112 | - <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | |
113 | - <Setter Property="IsTabStop" Value="false"/> | |
114 | - </Style> | |
115 | - </DataGrid.CellStyle> | |
116 | - | |
117 | - <DataGrid.Columns> | |
118 | - <DataGridTextColumn Header="概" Width="10" | |
119 | - Binding="{Binding Source={x:Static vm:IBookmarkDetailListViewModel.SUMMARY_LABEL}, Mode=OneWay}"> | |
120 | - <DataGridTextColumn.CellStyle> | |
121 | - <Style TargetType="DataGridCell"> | |
122 | - <Setter Property="ToolTip" Value="{Binding Summary.Value}" /> | |
123 | - </Style> | |
124 | - </DataGridTextColumn.CellStyle> | |
125 | - </DataGridTextColumn> | |
126 | - <DataGridTextColumn Header="タイトル" Width="300" | |
127 | - Binding="{Binding Title.Value}"> | |
128 | - <DataGridTextColumn.CellStyle> | |
129 | - <Style TargetType="DataGridCell"> | |
130 | - <Setter Property="ToolTip" Value="{Binding Title.Value}" /> | |
131 | - </Style> | |
132 | - </DataGridTextColumn.CellStyle> | |
133 | - </DataGridTextColumn> | |
134 | - <DataGridTextColumn Header="作者" Width="100" | |
135 | - Binding="{Binding Writer.Value}"> | |
136 | - <DataGridTextColumn.CellStyle> | |
137 | - <Style TargetType="DataGridCell"> | |
138 | - <Setter Property="ToolTip" Value="{Binding Writer.Value}" /> | |
139 | - </Style> | |
140 | - </DataGridTextColumn.CellStyle> | |
141 | - </DataGridTextColumn> | |
142 | - <DataGridTextColumn Header="完結" Width="20" | |
143 | - Binding="{Binding End.Value}"> | |
144 | - <DataGridTextColumn.ElementStyle> | |
145 | - <Style TargetType="{x:Type TextBlock}"> | |
146 | - <Setter Property="HorizontalAlignment" Value="Center" /> | |
147 | - </Style> | |
148 | - </DataGridTextColumn.ElementStyle> | |
149 | - </DataGridTextColumn> | |
150 | - <DataGridTextColumn Header="話数" Width="40" | |
151 | - Binding="{Binding GeneralAllNo.Value, StringFormat=\{0:N0\}}"> | |
152 | - <DataGridTextColumn.ElementStyle> | |
153 | - <Style TargetType="{x:Type TextBlock}"> | |
154 | - <Setter Property="HorizontalAlignment" Value="Right" /> | |
155 | - </Style> | |
156 | - </DataGridTextColumn.ElementStyle> | |
157 | - </DataGridTextColumn> | |
158 | - <DataGridTextColumn Header="長さ[h]" Width="50" | |
159 | - Binding="{Binding Time.Value, StringFormat=\{0:N0\}}"> | |
160 | - <DataGridTextColumn.ElementStyle> | |
161 | - <Style TargetType="{x:Type TextBlock}"> | |
104 | + Binding="{Binding Time.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}"> | |
105 | + <ctc:DataGridTextColumn.ElementStyle> | |
106 | + <Style TargetType="TextBlock"> | |
162 | 107 | <Setter Property="HorizontalAlignment" Value="Right" /> |
163 | 108 | </Style> |
164 | - </DataGridTextColumn.ElementStyle> | |
165 | - </DataGridTextColumn> | |
166 | - <DataGridTextColumn Header="エタ" Width="25" | |
167 | - Binding="{Binding IsStop.Value}"> | |
168 | - <DataGridTextColumn.ElementStyle> | |
169 | - <Style TargetType="{x:Type TextBlock}"> | |
170 | - <Setter Property="HorizontalAlignment" Value="Center" /> | |
171 | - </Style> | |
172 | - </DataGridTextColumn.ElementStyle> | |
173 | - </DataGridTextColumn> | |
174 | - <DataGridTextColumn Header="総合評価pt." Width="60" | |
175 | - Binding="{Binding GlobalPoint.Value, StringFormat=\{0:N0\}}"> | |
176 | - <DataGridTextColumn.ElementStyle> | |
177 | - <Style TargetType="{x:Type TextBlock}"> | |
109 | + </ctc:DataGridTextColumn.ElementStyle> | |
110 | + </ctc:DataGridTextColumn> | |
111 | + <ctc:DataGridTemplateColumn Header="エタ" Width="25"> | |
112 | + <ctc:DataGridTemplateColumn.CellTemplate> | |
113 | + <DataTemplate x:DataType="vm:IBookmarkDetailListRowViewModel"> | |
114 | + <Grid VerticalAlignment="Center"> | |
115 | + <TextBlock Text="{x:Bind IsStop.Value}" HorizontalAlignment="Center"/> | |
116 | + </Grid> | |
117 | + </DataTemplate> | |
118 | + </ctc:DataGridTemplateColumn.CellTemplate> | |
119 | + </ctc:DataGridTemplateColumn> | |
120 | + <ctc:DataGridTextColumn Header="総合評価pt." Width="100" | |
121 | + Binding="{Binding GlobalPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
122 | + <ctc:DataGridTextColumn.ElementStyle> | |
123 | + <Style TargetType="TextBlock"> | |
178 | 124 | <Setter Property="HorizontalAlignment" Value="Right" /> |
179 | 125 | </Style> |
180 | - </DataGridTextColumn.ElementStyle> | |
181 | - </DataGridTextColumn> | |
182 | - <DataGridTextColumn Header="評価/分" Width="50" | |
183 | - Binding="{Binding PointPerMin.Value, StringFormat=\{0:N0\}}"> | |
184 | - <DataGridTextColumn.ElementStyle> | |
185 | - <Style TargetType="{x:Type TextBlock}"> | |
126 | + </ctc:DataGridTextColumn.ElementStyle> | |
127 | + </ctc:DataGridTextColumn> | |
128 | + <ctc:DataGridTextColumn Header="評価/分" Width="80" | |
129 | + Binding="{Binding PointPerMin.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
130 | + <ctc:DataGridTextColumn.ElementStyle> | |
131 | + <Style TargetType="TextBlock"> | |
186 | 132 | <Setter Property="HorizontalAlignment" Value="Right" /> |
187 | 133 | </Style> |
188 | - </DataGridTextColumn.ElementStyle> | |
189 | - </DataGridTextColumn> | |
190 | - <DataGridTextColumn Header="日間pt." Width="50" | |
191 | - Binding="{Binding DailyPoint.Value, StringFormat=\{0:N0\}}"> | |
192 | - <DataGridTextColumn.ElementStyle> | |
193 | - <Style TargetType="{x:Type TextBlock}"> | |
134 | + </ctc:DataGridTextColumn.ElementStyle> | |
135 | + </ctc:DataGridTextColumn> | |
136 | + <ctc:DataGridTextColumn Header="日間pt." Width="80" | |
137 | + Binding="{Binding DailyPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
138 | + <ctc:DataGridTextColumn.ElementStyle> | |
139 | + <Style TargetType="TextBlock"> | |
194 | 140 | <Setter Property="HorizontalAlignment" Value="Right" /> |
195 | 141 | </Style> |
196 | - </DataGridTextColumn.ElementStyle> | |
197 | - </DataGridTextColumn> | |
198 | - <DataGridTextColumn Header="週間pt." Width="50" | |
199 | - Binding="{Binding WeeklyPoint.Value, StringFormat=\{0:N0\}}"> | |
200 | - <DataGridTextColumn.ElementStyle> | |
201 | - <Style TargetType="{x:Type TextBlock}"> | |
142 | + </ctc:DataGridTextColumn.ElementStyle> | |
143 | + </ctc:DataGridTextColumn> | |
144 | + <ctc:DataGridTextColumn Header="週間pt." Width="80" | |
145 | + Binding="{Binding WeeklyPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
146 | + <ctc:DataGridTextColumn.ElementStyle> | |
147 | + <Style TargetType="TextBlock"> | |
202 | 148 | <Setter Property="HorizontalAlignment" Value="Right" /> |
203 | 149 | </Style> |
204 | - </DataGridTextColumn.ElementStyle> | |
205 | - </DataGridTextColumn> | |
206 | - <DataGridTextColumn Header="月間pt." Width="50" | |
207 | - Binding="{Binding MonthlyPoint.Value, StringFormat=\{0:N0\}}"> | |
208 | - <DataGridTextColumn.ElementStyle> | |
209 | - <Style TargetType="{x:Type TextBlock}"> | |
150 | + </ctc:DataGridTextColumn.ElementStyle> | |
151 | + </ctc:DataGridTextColumn> | |
152 | + <ctc:DataGridTextColumn Header="月間pt." Width="80" | |
153 | + Binding="{Binding MonthlyPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
154 | + <ctc:DataGridTextColumn.ElementStyle> | |
155 | + <Style TargetType="TextBlock"> | |
210 | 156 | <Setter Property="HorizontalAlignment" Value="Right" /> |
211 | 157 | </Style> |
212 | - </DataGridTextColumn.ElementStyle> | |
213 | - </DataGridTextColumn> | |
214 | - <DataGridTextColumn Header="四半期pt." Width="50" | |
215 | - Binding="{Binding QuarterPoint.Value, StringFormat=\{0:N0\}}"> | |
216 | - <DataGridTextColumn.ElementStyle> | |
217 | - <Style TargetType="{x:Type TextBlock}"> | |
158 | + </ctc:DataGridTextColumn.ElementStyle> | |
159 | + </ctc:DataGridTextColumn> | |
160 | + <ctc:DataGridTextColumn Header="四半期pt." Width="80" | |
161 | + Binding="{Binding QuarterPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
162 | + <ctc:DataGridTextColumn.ElementStyle> | |
163 | + <Style TargetType="TextBlock"> | |
218 | 164 | <Setter Property="HorizontalAlignment" Value="Right" /> |
219 | 165 | </Style> |
220 | - </DataGridTextColumn.ElementStyle> | |
221 | - </DataGridTextColumn> | |
222 | - <DataGridTextColumn Header="年間pt." Width="50" | |
223 | - Binding="{Binding YearlyPoint.Value, StringFormat=\{0:N0\}}"> | |
224 | - <DataGridTextColumn.ElementStyle> | |
225 | - <Style TargetType="{x:Type TextBlock}"> | |
166 | + </ctc:DataGridTextColumn.ElementStyle> | |
167 | + </ctc:DataGridTextColumn> | |
168 | + <ctc:DataGridTextColumn Header="年間pt." Width="80" | |
169 | + Binding="{Binding YearlyPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
170 | + <ctc:DataGridTextColumn.ElementStyle> | |
171 | + <Style TargetType="TextBlock"> | |
226 | 172 | <Setter Property="HorizontalAlignment" Value="Right" /> |
227 | 173 | </Style> |
228 | - </DataGridTextColumn.ElementStyle> | |
229 | - </DataGridTextColumn> | |
230 | - <DataGridTextColumn Header="ブクマ数" Width="50" | |
231 | - Binding="{Binding FavNovelCnt.Value, StringFormat=\{0:N0\}}"> | |
232 | - <DataGridTextColumn.ElementStyle> | |
233 | - <Style TargetType="{x:Type TextBlock}"> | |
174 | + </ctc:DataGridTextColumn.ElementStyle> | |
175 | + </ctc:DataGridTextColumn> | |
176 | + <ctc:DataGridTextColumn Header="ブクマ数" Width="80" | |
177 | + Binding="{Binding FavNovelCnt.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
178 | + <ctc:DataGridTextColumn.ElementStyle> | |
179 | + <Style TargetType="TextBlock"> | |
234 | 180 | <Setter Property="HorizontalAlignment" Value="Right" /> |
235 | 181 | </Style> |
236 | - </DataGridTextColumn.ElementStyle> | |
237 | - </DataGridTextColumn> | |
238 | - <DataGridTextColumn Header="感想数" Width="50" | |
239 | - Binding="{Binding ImpressionCnt.Value, StringFormat=\{0:N0\}}"> | |
240 | - <DataGridTextColumn.ElementStyle> | |
241 | - <Style TargetType="{x:Type TextBlock}"> | |
182 | + </ctc:DataGridTextColumn.ElementStyle> | |
183 | + </ctc:DataGridTextColumn> | |
184 | + <ctc:DataGridTextColumn Header="感想数" Width="80" | |
185 | + Binding="{Binding ImpressionCnt.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
186 | + <ctc:DataGridTextColumn.ElementStyle> | |
187 | + <Style TargetType="TextBlock"> | |
242 | 188 | <Setter Property="HorizontalAlignment" Value="Right" /> |
243 | 189 | </Style> |
244 | - </DataGridTextColumn.ElementStyle> | |
245 | - </DataGridTextColumn> | |
246 | - <DataGridTextColumn Header="レビュー数" Width="40" | |
247 | - Binding="{Binding ReviewCnt.Value, StringFormat=\{0:N0\}}"> | |
248 | - <DataGridTextColumn.ElementStyle> | |
249 | - <Style TargetType="{x:Type TextBlock}"> | |
190 | + </ctc:DataGridTextColumn.ElementStyle> | |
191 | + </ctc:DataGridTextColumn> | |
192 | + <ctc:DataGridTextColumn Header="レビュー数" Width="60" | |
193 | + Binding="{Binding ReviewCnt.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
194 | + <ctc:DataGridTextColumn.ElementStyle> | |
195 | + <Style TargetType="TextBlock"> | |
250 | 196 | <Setter Property="HorizontalAlignment" Value="Right" /> |
251 | 197 | </Style> |
252 | - </DataGridTextColumn.ElementStyle> | |
253 | - </DataGridTextColumn> | |
254 | - <DataGridTextColumn Header="評価pt." Width="60" | |
255 | - Binding="{Binding AllPoint.Value, StringFormat=\{0:N0\}}"> | |
256 | - <DataGridTextColumn.ElementStyle> | |
257 | - <Style TargetType="{x:Type TextBlock}"> | |
198 | + </ctc:DataGridTextColumn.ElementStyle> | |
199 | + </ctc:DataGridTextColumn> | |
200 | + <ctc:DataGridTextColumn Header="評価pt." Width="80" | |
201 | + Binding="{Binding AllPoint.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
202 | + <ctc:DataGridTextColumn.ElementStyle> | |
203 | + <Style TargetType="TextBlock"> | |
258 | 204 | <Setter Property="HorizontalAlignment" Value="Right" /> |
259 | 205 | </Style> |
260 | - </DataGridTextColumn.ElementStyle> | |
261 | - </DataGridTextColumn> | |
262 | - <DataGridTextColumn Header="評価者数" Width="50" | |
263 | - Binding="{Binding AllHyokaCnt.Value, StringFormat=\{0:N0\}}"> | |
264 | - <DataGridTextColumn.ElementStyle> | |
265 | - <Style TargetType="{x:Type TextBlock}"> | |
206 | + </ctc:DataGridTextColumn.ElementStyle> | |
207 | + </ctc:DataGridTextColumn> | |
208 | + <ctc:DataGridTextColumn Header="評価者数" Width="70" | |
209 | + Binding="{Binding AllHyokaCnt.Value, Converter={StaticResource StringFormat},ConverterParameter=\{0:N0\}}" > | |
210 | + <ctc:DataGridTextColumn.ElementStyle> | |
211 | + <Style TargetType="TextBlock"> | |
266 | 212 | <Setter Property="HorizontalAlignment" Value="Right" /> |
267 | 213 | </Style> |
268 | - </DataGridTextColumn.ElementStyle> | |
269 | - </DataGridTextColumn> | |
270 | - <DataGridTextColumn Header="最終掲載日" Width="80" | |
214 | + </ctc:DataGridTextColumn.ElementStyle> | |
215 | + </ctc:DataGridTextColumn> | |
216 | + <ctc:DataGridTextColumn Header="最終掲載日" Width="100" | |
271 | 217 | Binding="{Binding GeneralLastUp.Value}"> |
272 | - <DataGridTextColumn.ElementStyle> | |
273 | - <Style TargetType="{x:Type TextBlock}"> | |
218 | + <ctc:DataGridTextColumn.ElementStyle> | |
219 | + <Style TargetType="TextBlock"> | |
274 | 220 | <Setter Property="HorizontalAlignment" Value="Right" /> |
275 | 221 | </Style> |
276 | - </DataGridTextColumn.ElementStyle> | |
277 | - </DataGridTextColumn> | |
278 | - <DataGridTextColumn Header="初回掲載日" Width="80" | |
222 | + </ctc:DataGridTextColumn.ElementStyle> | |
223 | + </ctc:DataGridTextColumn> | |
224 | + <ctc:DataGridTextColumn Header="初回掲載日" Width="100" | |
279 | 225 | Binding="{Binding GeneralFirstUp.Value}"> |
280 | - <DataGridTextColumn.ElementStyle> | |
281 | - <Style TargetType="{x:Type TextBlock}"> | |
226 | + <ctc:DataGridTextColumn.ElementStyle> | |
227 | + <Style TargetType="TextBlock"> | |
282 | 228 | <Setter Property="HorizontalAlignment" Value="Right" /> |
283 | 229 | </Style> |
284 | - </DataGridTextColumn.ElementStyle> | |
285 | - </DataGridTextColumn> | |
286 | - <DataGridTextColumn Header="小説更新日" Width="80" | |
230 | + </ctc:DataGridTextColumn.ElementStyle> | |
231 | + </ctc:DataGridTextColumn> | |
232 | + <ctc:DataGridTextColumn Header="小説更新日" Width="100" | |
287 | 233 | Binding="{Binding NovelUpdatedAt.Value}"> |
288 | - <DataGridTextColumn.ElementStyle> | |
289 | - <Style TargetType="{x:Type TextBlock}"> | |
234 | + <ctc:DataGridTextColumn.ElementStyle> | |
235 | + <Style TargetType="TextBlock"> | |
290 | 236 | <Setter Property="HorizontalAlignment" Value="Right" /> |
291 | 237 | </Style> |
292 | - </DataGridTextColumn.ElementStyle> | |
293 | - </DataGridTextColumn> | |
294 | - </DataGrid.Columns> | |
295 | - </DataGrid> | |
238 | + </ctc:DataGridTextColumn.ElementStyle> | |
239 | + </ctc:DataGridTextColumn> | |
240 | + | |
241 | + </ctc:DataGrid.Columns> | |
242 | + | |
243 | + </ctc:DataGrid> | |
244 | + | |
245 | + <!-- | |
246 | + <ListView ItemsSource="{x:Bind ViewModel.Rows, Mode=OneWay}" | |
247 | + SelectedItem="{x:Bind ViewModel.SelectedItem.Value, Mode=TwoWay}" | |
248 | + SelectionMode="Single"> | |
249 | + | |
250 | + <ListView.ItemTemplate> | |
251 | + <DataTemplate> | |
252 | + <Grid Padding="10"> | |
253 | + <Grid.RowDefinitions> | |
254 | + <RowDefinition Height="auto"/> | |
255 | + <RowDefinition Height="auto"/> | |
256 | + </Grid.RowDefinitions> | |
257 | + <TextBlock Grid.Row="0" FontSize="24" FontWeight="Bold" | |
258 | + Text="{Binding Title.Value}" TextWrapping="Wrap" /> | |
259 | + <StackPanel Grid.Row="1" Orientation="Horizontal"> | |
260 | + <TextBlock Text="作:"/> | |
261 | + <TextBlock Text="{Binding Writer.Value}"/> | |
262 | + <TextBlock Text="総合評価:" Padding="10,0,0,0"/> | |
263 | + <TextBlock Text="{Binding GlobalPoint.Value}"/> | |
264 | + </StackPanel> | |
265 | + </Grid> | |
266 | + | |
267 | + </DataTemplate> | |
268 | + </ListView.ItemTemplate> | |
269 | + | |
270 | + </ListView> | |
296 | 271 | --> |
297 | 272 | |
298 | 273 | </UserControl> |