11using Ink_Canvas . Controls ;
22using Ink_Canvas . Helpers ;
3+ using Ink_Canvas . Properties ;
34using Newtonsoft . Json ;
45using System ;
56using System . Collections . Generic ;
@@ -70,7 +71,7 @@ public static FrameworkElement BuildView(string id, IBoardToolbarHost host)
7071 }
7172 }
7273
73- public static List < FrameworkElement > BuildGroup ( IBoardToolbarHost host , List < BoardToolbarComponentEntry > components )
74+ public static List < FrameworkElement > BuildGroup ( IBoardToolbarHost host , List < BoardToolbarComponentEntry > components , string areaId = null )
7475 {
7576 var views = new List < FrameworkElement > ( ) ;
7677 var items = Discover ( ) ;
@@ -82,7 +83,7 @@ public static List<FrameworkElement> BuildGroup(IBoardToolbarHost host, List<Boa
8283
8384 if ( entry . Id == "board.pageInfo" )
8485 {
85- var pageInfoView = BuildPageInfoView ( host ) ;
86+ var pageInfoView = BuildPageInfoView ( host , areaId ) ;
8687 if ( pageInfoView != null )
8788 {
8889 views . Add ( pageInfoView ) ;
@@ -105,6 +106,8 @@ public static List<FrameworkElement> BuildGroup(IBoardToolbarHost host, List<Boa
105106 item . ApplyPosition ( view , position ) ;
106107 ApplyComponentSettings ( view , entry ) ;
107108 host . RegisterView ( entry . Id , view ) ;
109+ if ( areaId != null )
110+ host . RegisterView ( $ "{ entry . Id } .{ areaId } ", view ) ;
108111 views . Add ( view ) ;
109112 }
110113 }
@@ -117,29 +120,44 @@ public static List<FrameworkElement> BuildGroup(IBoardToolbarHost host, List<Boa
117120 return views ;
118121 }
119122
120- private static FrameworkElement BuildPageInfoView ( IBoardToolbarHost host )
123+ private static FrameworkElement BuildPageInfoView ( IBoardToolbarHost host , string areaId )
121124 {
122125 var pageInfoTextBlock = new TextBlock
123126 {
124127 Text = "1/1" ,
128+ HorizontalAlignment = HorizontalAlignment . Center ,
129+ Margin = new Thickness ( 0 , - 1 , 0 , 0 ) ,
130+ FontSize = 17 ,
131+ FontWeight = FontWeights . Bold ,
132+ TextAlignment = TextAlignment . Center
133+ } ;
134+ host . RegisterView ( $ "board.pageInfo.{ areaId } ", pageInfoTextBlock ) ;
135+
136+ var pageLabel = new TextBlock
137+ {
138+ Text = FloatingBarStrings . Board_Page ,
125139 Foreground = ( Brush ) Application . Current . TryFindResource ( "FloatBarForeground" ) ,
126- VerticalAlignment = VerticalAlignment . Center ,
140+ VerticalAlignment = VerticalAlignment . Bottom ,
127141 HorizontalAlignment = HorizontalAlignment . Center ,
128- FontSize = 14
142+ FontSize = 12
129143 } ;
130- host . RegisterView ( "board.pageInfo" , pageInfoTextBlock ) ;
144+
145+ var grid = new Grid { Margin = new Thickness ( 6 , 6 , 6 , 4 ) } ;
146+ grid . Children . Add ( pageInfoTextBlock ) ;
147+ grid . Children . Add ( pageLabel ) ;
131148
132149 var pageInfoBorder = new Border
133150 {
134- CornerRadius = new CornerRadius ( 2 ) ,
135- Margin = new Thickness ( 2 , 0 , 2 , 0 ) ,
136- Padding = new Thickness ( 6 , 0 , 6 , 0 ) ,
137- Child = pageInfoTextBlock ,
138- Cursor = System . Windows . Input . Cursors . Hand ,
139- Background = Brushes . Transparent ,
140- VerticalAlignment = VerticalAlignment . Stretch
151+ Width = 75 ,
152+ Height = 50 ,
153+ BorderThickness = new Thickness ( 1 ) ,
154+ BorderBrush = ( Brush ) Application . Current . TryFindResource ( "BoardFloatBarBorderBrush" ) ,
155+ Background = ( Brush ) Application . Current . TryFindResource ( "BoardFloatBarBackground" ) ,
156+ Opacity = 1 ,
157+ Child = grid ,
158+ Cursor = System . Windows . Input . Cursors . Hand
141159 } ;
142- host . RegisterView ( "board.pageList.rightBtn " , pageInfoBorder ) ;
160+ host . RegisterView ( $ "board.pageList.{ areaId } Btn ", pageInfoBorder ) ;
143161 return pageInfoBorder ;
144162 }
145163
@@ -202,7 +220,7 @@ public static Border CreateGroupBorder(List<FrameworkElement> views, Orientation
202220 {
203221 CornerRadius = new CornerRadius ( 5 , 5 , 5 , 5 ) ,
204222 Background = ( Brush ) Application . Current . TryFindResource ( "BoardFloatBarBackground" ) ,
205- Margin = new Thickness ( 0 , 0 , 5 , 0 ) ,
223+ Margin = new Thickness ( 0 ) ,
206224 Child = panel
207225 } ;
208226
@@ -375,7 +393,7 @@ private static void RebuildArea(IBoardToolbarHost host, Panel container, BoardTo
375393
376394 foreach ( var group in area . Groups )
377395 {
378- var views = BuildGroup ( host , group . Components ) ;
396+ var views = BuildGroup ( host , group . Components , area . Id ) ;
379397 if ( views . Count > 0 )
380398 {
381399 container . Children . Add ( CreateGroupBorder ( views ) ) ;
0 commit comments