如何引用同一数据模板中每个组之前生成的视图框?

时间:2012-12-11 09:34:21

标签: c# xaml windows-8

我正在使用C#和XAML开发一个Windows 8应用程序。在我的DataTemplate中,我有6个在每个组之前自动生成的视图框。 我需要指定在每个组之前生成哪一个。我不希望他们都在每个小组面前展示。我将提供截图和代码,使其变得更加清晰。

 <Style x:Key="GroupItemStyle1" TargetType="GroupItem">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GroupItem">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="431*"/>
                                <ColumnDefinition Width="429*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <ContentControl x:Name="HeaderContent" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Content="{TemplateBinding Content}" IsTabStop="False" Margin="{TemplateBinding Padding}" TabIndex="0" Grid.Column="1"/>
                            <ItemsControl x:Name="ItemsControl" IsTabStop="False" ItemsSource="{Binding GroupItems}" Grid.Row="1" TabIndex="1" TabNavigation="Once" Grid.Column="1">
                                <ItemsControl.ItemContainerTransitions>
                                    <TransitionCollection>
                                        <AddDeleteThemeTransition/>
                                        <ContentThemeTransition/>
                                        <ReorderThemeTransition/>
                                        <EntranceThemeTransition IsStaggeringEnabled="False"/>
                                    </TransitionCollection>
                                </ItemsControl.ItemContainerTransitions>
                            </ItemsControl>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,-350,0,0" Visibility="Visible" x:Name="Facebook">
                                <Grid>
                                    <Grid Name="backgroundGrid" Width="32" Height="32" Visibility="Visible"/>
                                    <Path Data="F1M-1775.32,-68.9708L-1831.47,-68.9708C-1833.27,-68.9708,-1834.73,-67.3745,-1834.73,-65.4058L-1834.73,-10.1649C-1834.73,-8.19482,-1833.27,-6.59973,-1831.47,-6.59973L-1802.47,-6.59973 -1802.47,-32.2261 -1809.5,-32.2261 -1809.5,-40.5503 -1802.47,-40.5503 -1802.47,-45.5282C-1802.47,-50.9435,-1798.08,-55.3315,-1792.66,-55.3315L-1783.74,-55.3315 -1783.74,-47.0099 -1787.86,-47.0099C-1789.89,-47.0099,-1791.53,-45.3667,-1791.53,-43.3407L-1791.53,-40.5503 -1783.74,-40.5503 -1783.74,-32.2261 -1791.53,-32.2261 -1791.53,-6.59973 -1775.32,-6.59973C-1773.52,-6.59973,-1772.06,-8.19482,-1772.06,-10.1649L-1772.06,-65.4058C-1772.06,-67.3745,-1773.52,-68.9708,-1775.32,-68.9708" Stretch="Uniform" Fill="#3b5998" Width="32" Height="32" HorizontalAlignment="Left"  Grid.Row="1" VerticalAlignment="Top" Margin="0,4,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,-270,0,0">
                                <Grid>
                                    <Grid Name="backgroundGrid1" Width="32" Height="32" Visibility="Visible">
                                        <Rectangle Fill="#FFFFF9F9" Name="Rect" Visibility="Visible" />
                                    </Grid>
                                    <Path Data="M-1777.84,-735.739C-1779.26,-736.059 -1779.02,-735.992 -1777.83,-736.24 -1774.63,-736.906 -1772.58,-737.916 -1772.35,-739.471 -1774.46,-738.8 -1776.62,-738.775 -1778.92,-739.183 -1779.98,-739.371 -1779.7,-739.271 -1779.93,-740.311 -1781.63,-747.819 -1787.53,-751.349 -1793.08,-751.454 -1786.29,-752.91 -1786.07,-755.831 -1792.48,-753.538 -1790.13,-754.984 -1789.89,-756.332 -1793.3,-754.722 -1793.91,-754.412 -1794.7,-753.83 -1795.24,-753.394 -1794.01,-755.809 -1795.09,-755.113 -1797.2,-752.919 -1800.02,-749.981 -1802.47,-745.925 -1804.47,-739.667 -1808.83,-744.16 -1816.2,-747.195 -1823.59,-750.022 -1825.24,-750.655 -1825.66,-751.22 -1825.25,-749.015 -1824.82,-746.675 -1823.12,-744.559 -1820.27,-742.834 -1821.23,-742.786 -1822.31,-742.674 -1823.15,-742.462 -1824,-742.244 -1823.96,-742.287 -1823.71,-741.447 -1822.94,-738.91 -1820.73,-737.018 -1817.1,-735.981 -1818.35,-735.883 -1819.57,-735.599 -1820.45,-734.955 -1821.26,-734.37 -1821.26,-734.311 -1820.76,-733.551 -1819.46,-731.546 -1817.23,-730.438 -1813.73,-730.403 -1817.43,-728.518 -1816.22,-725.026 -1811.56,-725.026 -1818.67,-717.951 -1828.26,-719.07 -1834.73,-724.146 -1824.87,-710.215 -1805.21,-709.103 -1791.71,-716.767 -1785.95,-720.032 -1781.41,-725.233 -1779.42,-732.494 -1776.24,-732.533 -1773.67,-733.483 -1772.06,-735.339 -1774.13,-735.243 -1776.09,-735.345 -1777.84,-735.739" Stretch="Uniform" Fill="#FF00C3F8" Width="24" Height="24" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,-190,0,0">
                                <Grid>
                                    <Grid Name="backgroundGrid3" Width="32" Height="32" Visibility="Collapsed" />
                                    <Path Data="M0.80001831,19.480004L14.232019,19.480004 14.232019,59.898005 0.80001831,59.898005z M47.20809,18.530005C56.037544,18.530005,62.666962,24.309214,62.666962,36.717749L62.666962,59.895002 49.237976,59.895002 49.237976,38.27762C49.237976,32.838213 47.288162,29.138709 42.428396,29.138709 38.718697,29.138709 36.508891,31.638407 35.538989,34.04815 35.178906,34.908031 35.098956,36.117846 35.098956,37.327662L35.098956,59.895002 21.659961,59.895002C21.659961,59.895002,21.83988,23.269423,21.659961,19.479842L35.098956,19.479842 35.098956,25.20913C35.068929,25.249164,35.039024,25.299207,35.008997,25.339119L35.098956,25.339119 35.098956,25.20913C36.87886,22.449453,40.068577,18.530005,47.20809,18.530005z M7.6005096,0C12.200819,0 15.031009,3.0208731 15.111014,6.9820194 15.111014,10.863142 12.200819,13.964039 7.520504,13.964039L7.4304981,13.964039C2.9201946,13.964039 0,10.863142 0,6.9820194 0,3.0208731 3.0102024,0 7.6005096,0z" Stretch="Uniform" Fill="#FF5BA8CF" Width="22" Height="22" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,-110,0,0">
                                <Grid>
                                    <Grid Name="backgroundGrid4" Width="32" Height="32" Visibility="Collapsed" />
                                    <Path Data="M21.412441,42.860001C21.906038,42.860001 22.150736,42.860001 22.542833,42.905701 26.253611,45.505823 27.863001,46.804134 27.863001,49.263756 27.863001,52.249481 25.374716,54.476002 20.679445,54.476002 15.451578,54.476002 12.082,52.013779 12.082,48.593151 12.082,45.17252 15.20158,44.018909 16.281073,43.629606 18.33576,42.9512 20.972343,42.860001 21.412441,42.860001z M44.261799,29.53775L44.261799,36.900175 36.923302,36.900175 36.923302,41.919827 44.261799,41.919827 44.261799,49.229549 49.242298,49.229549 49.242298,41.919827 56.6161,41.919827 56.6161,36.900175 49.242298,36.900175 49.242298,29.53775z M19.019857,21.360001C23.074421,21.360001 25.176001,26.756422 25.176001,30.235055 25.176001,31.093163 25.077101,32.631577 23.961012,33.744287 23.17342,34.513794 21.860832,35.101 20.629143,35.101 16.432682,35.101 14.512,29.74475 14.512,26.51372 14.512,25.263708 14.764598,23.961036 15.59419,22.961026 16.381783,21.985007 17.75017,21.360001 19.019857,21.360001z M22.097799,19.7377C19.4636,19.7377 16.131599,20.138817 13.3555,22.410223 11.2449,24.182296 10.2136,26.650281 10.2136,28.869757 10.2136,32.62952 13.1564,36.444582 18.3361,36.444582 18.824301,36.444582 19.362101,36.393881 19.906401,36.348181 19.656401,36.931576 19.4104,37.417171 19.4104,38.225763 19.4104,39.725748 20.1915,40.638639 20.879,41.499229 18.6759,41.650127 14.5691,41.893826 11.5483,43.723007 8.6563702,45.411791 7.7761202,47.874165 7.7761202,49.604546 7.7761202,53.172211 11.1929,56.493877 18.281401,56.493877 26.6877,56.493877 31.136801,51.917023 31.136801,47.385868 31.136801,44.068203 29.1877,42.422321 27.038,40.638639L25.281401,39.285652C24.7423,38.859858 24,38.275263 24,37.217974 24,36.163284 24.7423,35.479691 25.375099,34.850798 27.4298,33.268114 29.4858,31.494631 29.4858,27.929667 29.4858,24.263715 27.129,22.410224 26.006599,21.336014L29.035299,21.336014 32.168098,19.7377z M0,14.769001L64,14.769001 64,51.46003C64,58.354458,58.355499,63.999001,51.457199,63.999001L12.5432,63.999001C5.6445298,63.999001,0,58.354458,0,51.46003z M12.543236,0L51.457134,0C58.173214,9.5367432E-07,63.6563,5.3606014,63.944,12L0.055000305,12C0.34406164,5.3606014,5.8270831,9.5367432E-07,12.543236,0z" Stretch="Uniform" Fill="#c93f2f" Width="32" Height="32" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,-30,0,0">
                                <Grid>
                                    <Grid Name="backgroundGrid5" Width="32" Height="32" Visibility="Visible">
                                        <Rectangle Fill="#FFFFF9F9" Name="Rect1" Visibility="Visible" />
                                    </Grid>
                                    <Path Data="F1M444.262,749.255L444.262,756.674C444.262,757.137 444.166,757.561 443.968,757.949 443.773,758.339 443.504,758.68 443.166,758.973 442.827,759.268 442.437,759.495 441.991,759.665 441.546,759.833 441.064,759.919 440.549,759.919L425.385,759.919C424.879,759.919 424.403,759.833 423.958,759.665 423.512,759.495 423.119,759.268 422.783,758.973 422.447,758.68 422.176,758.339 421.978,757.949 421.78,757.561 421.684,757.137 421.684,756.674L421.684,749.255C421.684,748.814 421.78,748.395 421.978,747.995 422.176,747.596 422.447,747.251 422.783,746.964 423.119,746.678 423.512,746.445 423.958,746.271 424.403,746.098 424.879,746.01 425.385,746.01L440.549,746.01C441.054,746.01 441.53,746.098 441.984,746.271 442.434,746.445 442.827,746.678 443.166,746.964 443.504,747.251 443.773,747.596 443.968,747.995 444.166,748.395 444.262,748.814 444.262,749.255z M426.4,757.501L426.4,749.675 428.26,749.675 428.26,748.493 423.239,748.493 423.239,749.643 424.848,749.643 424.848,757.501 426.4,757.501z M427.158,739.297L425.08,734.752 426.89,734.752 427.924,738.149 428.955,734.752 430.762,734.752 428.814,739.297 428.814,744.591 427.158,744.591 427.158,739.297z M432.046,750.825L430.491,750.825 430.491,755.002C430.491,755.304 430.494,755.54 430.507,755.701 430.517,755.867 430.494,755.971 430.439,756.015 430.392,756.195 430.262,756.327 430.038,756.412 429.825,756.495 429.658,756.377 429.541,756.047 429.517,756.003 429.515,755.893 429.528,755.719 429.538,755.544 429.541,755.316 429.541,755.033L429.51,750.825 427.955,750.825 427.991,754.968C427.991,755.294 427.984,755.566 427.973,755.786 427.963,756.006 427.965,756.171 427.991,756.285 428.012,756.467 428.033,756.659 428.056,756.868 428.077,757.075 428.184,757.243 428.379,757.367 428.559,757.479 428.77,757.537 429.01,757.537 429.254,757.537 429.491,757.495 429.721,757.416 429.955,757.336 430.166,757.229 430.364,757.089 430.559,756.949 430.705,756.797 430.793,756.64L430.762,757.467 432.046,757.501 432.046,750.825z M430.624,739.991C430.624,739.372 430.684,738.857 430.793,738.455 430.931,738.037 431.148,737.739 431.455,737.558 431.76,737.333 432.148,737.219 432.622,737.219 433.038,737.219 433.385,737.288 433.669,737.423 433.95,737.536 434.181,737.732 434.361,738.015 434.497,738.218 434.598,738.447 434.666,738.708 434.731,738.989 434.767,739.367 434.767,739.841L434.767,741.613C434.767,742.257 434.731,742.718 434.666,743.002 434.64,743.26 434.53,743.547 434.325,743.864 434.124,744.144 433.905,744.33 433.669,744.421 433.385,744.557 433.067,744.623 432.702,744.623 432.335,744.623 431.991,744.567 431.692,744.454 431.408,744.364 431.197,744.2 431.067,743.966 430.931,743.782 430.817,743.531 430.726,743.202 430.661,742.897 430.624,742.438 430.624,741.817L430.624,739.991z M432.01,742.747C432.01,742.926 432.077,743.088 432.215,743.23 432.348,743.369 432.512,743.439 432.702,743.439 432.882,743.439 433.043,743.373 433.187,743.236 433.327,743.104 433.395,742.938 433.395,742.747L433.395,739.079C433.395,738.876 433.327,738.706 433.187,738.566 433.043,738.424 432.882,738.352 432.702,738.352 432.523,738.352 432.361,738.424 432.223,738.566 432.083,738.706 432.01,738.876 432.01,739.079L432.01,742.747z M437.064,755.592L437.064,752.127C437.064,751.463 436.83,750.989 436.356,750.708 436.2,750.618 436.015,750.572 435.814,750.572 435.439,750.572 435.015,750.747 434.53,751.096L434.53,748.493 432.976,748.493 432.976,757.434 434.26,757.4 434.361,756.843C434.778,757.193 435.155,757.407 435.484,757.486 435.819,757.563 436.098,757.533 436.33,757.391 436.562,757.252 436.741,757.021 436.869,756.699 436.999,756.378 437.064,756.007 437.064,755.592z M435.189,751.434C435.369,751.434 435.528,751.488 435.671,751.596 435.812,751.702 435.882,751.824 435.882,751.958L435.882,755.881C435.882,756.015 435.812,756.132 435.671,756.234 435.528,756.335 435.369,756.387 435.189,756.387 435.007,756.387 434.848,756.335 434.705,756.234 434.567,756.132 434.497,756.015 434.497,755.881L434.497,751.958C434.497,751.824 434.567,751.702 434.705,751.596 434.848,751.488 435.007,751.434 435.189,751.434z M435.913,743.898C435.874,743.807 435.843,743.712 435.833,743.618 435.819,743.523 435.804,743.429 435.778,743.339 435.757,743.226 435.747,743.074 435.747,742.881L435.747,742.139 435.747,737.491 437.2,737.491 437.2,742.865C437.2,743.002 437.249,743.118 437.351,743.221 437.455,743.321 437.588,743.373 437.757,743.373 437.916,743.373 438.049,743.321 438.161,743.221 438.275,743.118 438.335,743.002 438.335,742.865L438.335,737.491 439.681,737.491 439.681,744.387 437.963,744.387 437.994,743.83C437.835,744.054 437.684,744.23 437.538,744.352 437.358,744.464 437.161,744.521 436.944,744.521 436.687,744.521 436.471,744.464 436.301,744.352 436.155,744.253 436.025,744.1 435.913,743.898z M441.965,755.154L440.801,755.154 440.801,755.322 440.801,755.913C440.801,756.094 440.736,756.234 440.606,756.335 440.476,756.438 440.322,756.486 440.142,756.486L439.903,756.486C439.723,756.486 439.577,756.438 439.458,756.335 439.338,756.234 439.278,756.094 439.278,755.913L439.278,755.847 439.278,755.187 439.278,754.307 441.965,754.307 441.965,753.377C441.965,753.029 441.96,752.693 441.947,752.373 441.937,752.05 441.911,751.8 441.866,751.622 441.819,751.316 441.684,751.071 441.45,750.885 441.221,750.7 440.95,750.572 440.64,750.506 440.33,750.436 440.015,750.425 439.692,750.471 439.372,750.516 439.096,750.622 438.853,750.791 438.554,750.994 438.335,751.271 438.197,751.622 438.062,751.968 437.994,752.454 437.994,753.075L437.994,755.154C437.994,756.031 438.226,756.658 438.689,757.029 439.116,757.377 439.564,757.553 440.038,757.553 440.085,757.553 440.129,757.553 440.176,757.553 440.708,757.52 441.174,757.294 441.58,756.877 441.882,756.574 442.036,756.171 442.036,755.678 442.02,755.52 442.002,755.344 441.965,755.154z M440.765,753.174L439.278,753.174 439.312,752.348C439.312,752.167 439.379,752.02 439.515,751.899 439.65,751.781 439.812,751.721 440.007,751.721L440.075,751.721C440.275,751.721 440.447,751.778 440.588,751.89 440.726,752.003 440.801,752.156 440.801,752.348L440.765,753.174z" Stretch="Uniform" Fill="#FFB01E1E" Width="26" Height="26" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                            <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Margin="0,420,0,0">
                                <Grid>
                                    <Grid Name="backgroundGrid2" Width="32" Height="32" Visibility="Collapsed" />
                                    <Path Data="M3.6847152,20.087C4.7106925,20.087 5.5517813,20.441095 6.2651974,21.194885 7.0178319,21.950275 7.3719999,22.794064 7.3719999,23.814749 7.3719999,24.839436 7.0178319,25.683325 6.2651974,26.395414 5.5517813,27.149405 4.7106925,27.506001 3.6847152,27.506001 2.669197,27.506001 1.8202889,27.149405 1.0651651,26.395414 0.35679018,25.683325 -4.4703484E-08,24.839436 0,23.814749 -4.4703484E-08,22.794064 0.35679018,21.950275 1.0651651,21.194885 1.8202889,20.441095 2.669197,20.087 3.6847152,20.087z M0.17999993,9.2860003C5.1514217,9.2860003 9.3285557,11.017709 12.885932,14.572485 16.393676,18.129662 18.175001,22.350933 18.175001,27.282001L12.885932,27.282001C12.885932,25.638811 12.617629,23.992922 11.95102,22.394033 11.331312,20.840643 10.3963,19.505852 9.198424,18.262461 7.9978782,17.064569 6.6175805,16.129675 5.0628802,15.508579 3.5107302,14.840683 1.9092294,14.529386 0.17999993,14.529386z M0.17999993,0C7.7320277,0 14.127627,2.6639707 19.463537,7.9985123 24.749845,13.329154 27.413999,19.818682 27.413999,27.329L22.171789,27.329C22.171789,21.239367 19.994728,16.040024 15.724,11.685972 11.461074,7.4177084 6.2657429,5.2420721 0.17999993,5.2420721z" Stretch="Uniform" Fill="WhiteSmoke" Width="32" Height="32" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
                                        <Path.RenderTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <RotateTransform Angle="0" />
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Viewbox>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <CollectionViewSource
        x:Name="groupedItemsViewSource"
        Source="{Binding Groups}"
        IsSourceGrouped="true"
        ItemsPath="TopItems"
        d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:DataSource, IsDesignTimeCreatable=True}}"/>


    <DataTemplate x:Key="CustomTileItem">
       <Grid> 
            <Grid HorizontalAlignment="Left">
                <TextBox Text="{Binding Subtitle}" Width="300" Height="150" Background="Aqua"/>
                <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}">
                    <VariableSizedWrapGrid>
                        <Image Source="{Binding Path=Image}" Stretch="UniformToFill" />
                    </VariableSizedWrapGrid>
                </Border>
                <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}">
                    <telerikPrimitives:RadSlideHubTile Width="Auto" Height="38" telerikPrimitives:HubTileService.GroupTag="FirstLook" Visibility="Visible" Background="Transparent" BorderBrush="Transparent">
                    <telerikPrimitives:RadSlideHubTile.TopContent>
                            <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" FontFamily="Seguo"  FontSize="14" TextWrapping="Wrap"  Height="35" Margin="10,5,10,0" VerticalAlignment="Center" />
                        </telerikPrimitives:RadSlideHubTile.TopContent>
                        <telerikPrimitives:RadSlideHubTile.BottomContent>
                            <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" FontFamily="Seguo"  FontSize="14" TextWrapping="Wrap"  Height="35" Margin="10,10,10,0" VerticalAlignment="Center" />
                        </telerikPrimitives:RadSlideHubTile.BottomContent>
                    </telerikPrimitives:RadSlideHubTile>
                </StackPanel>
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ZoomedOut">
        <Grid HorizontalAlignment="Left" >
            <Border Background="LightGray">
                <TextBlock Text="{Binding Group.Title}" Width="250" Height="Auto" Foreground="Black" Padding="25,20,25,20" FontWeight="Bold"/>
            </Border>
        </Grid>
    </DataTemplate>

</UserControl.Resources>

<!--
    This grid acts as a root panel for the page that defines two rows:
    * Row 0 contains the back button and page title
    * Row 1 contains the rest of the page layout -->
<Grid Background="WhiteSmoke">
    <ProgressBar x:Name="pbProgress" IsIndeterminate="True" VerticalAlignment="Top" Value="100" Height="20"/>
    <Grid Style="{StaticResource LayoutRootStyle}" Margin="0,20,0,0" x:Name="itemGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="140" />
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid> 
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=Pageroot}" Style="{StaticResource BackButtonStyle}" Margin="36,0,0,36" Grid.Row="0"/>
            <StackPanel x:Name="Header" Grid.Row="0" Grid.Column="1" >
                <StackPanel Orientation="Horizontal">
                    <Image HorizontalAlignment="Left" Height="Auto" Margin="35,30,0,0" VerticalAlignment="Top" Width="202" Source="Assets/ACE-Logo.png"></Image>
                </StackPanel>
            </StackPanel>
        </Grid>
        <!-- Horizontal scrolling grid used in most view states -->
        <SemanticZoom Name="Zoom" Grid.Row="1">
            <SemanticZoom.ZoomedInView>
                <local:HubItems
                x:Name="itemGridView"
                AutomationProperties.AutomationId="ItemGridView"
                AutomationProperties.Name="Grouped Items"
                Grid.Row="1"
                Margin="0,-3,0,0"
                Padding="116,0,40,20"
                ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
                ItemTemplate="{StaticResource CustomTileItem}"
                SelectionMode="None"
                IsItemClickEnabled="True"
                ItemClick="ItemView_ItemClick">

                <local:HubItems.ItemsPanel>
                         <ItemsPanelTemplate>
                            <VirtualizingStackPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </local:HubItems.ItemsPanel>
                    <local:HubItems.GroupStyle>
                        <GroupStyle ContainerStyle="{StaticResource GroupItemStyle1}">
                            <GroupStyle.HeaderTemplate>
                              <DataTemplate>
                                    <Grid Margin="0,0,0,6" x:Name="HeaderGrid">
                                        <Button AutomationProperties.Name="Group Title"  Content="{Binding Title}" Style="{StaticResource TextButtonStyle}"/>
                                    </Grid>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                            <GroupStyle.Panel>
                                <ItemsPanelTemplate>
                                    <VariableSizedWrapGrid ItemWidth="75" ItemHeight="150" Orientation="Vertical" Margin="0,-420,80,0" MaximumRowsOrColumns="3"/>
                                </ItemsPanelTemplate>
                            </GroupStyle.Panel>
                        </GroupStyle>
                    </local:HubItems.GroupStyle>
                </local:HubItems>
            </SemanticZoom.ZoomedInView>
            <SemanticZoom.ZoomedOutView>
                <GridView x:Name="ZoomedOutGV" HorizontalAlignment="Left" Margin="-870,0,0,50" 
                          ItemTemplate="{StaticResource ZoomedOut}">
                        <GridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel Orientation="Vertical" HorizontalAlignment="left"/>
                        </ItemsPanelTemplate>
                    </GridView.ItemsPanel>
                        </GridView>
            </SemanticZoom.ZoomedOutView>
        </SemanticZoom>

0 个答案:

没有答案