سؤال

I am working in windows store apps and I need help.. I am trying to adapt my app for the differents visual state (FullScreenLandscape, FullScreenPortrait, Snapped, etc) and I need to reuse the controls for each visual state..

I create a grid for each visual state for example

        <Grid x:Name="PortraitView" Visibility="Collapsed">

        </Grid>

        <Grid x:Name="FillView" Visibility="Visible">

        </Grid>

        <Grid x:Name="SnapView" Visibility="Collapsed">

        </Grid>

but my problem is that I can not repeat the x:name of the controls that I set in the Grid= PortraitView..

how can I resolve it?

thanks

هل كانت مفيدة؟

المحلول

From MSDN

The most common usage of this property is to specify a XAML element name as an attribute in markup. This property essentially provides a WPF framework-level convenience property to set the XAML x:Name Directive.

Names must be unique within a namescope.

For more information, see XAML Namescopes.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top