Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ListView绑定到集合,如何访问父类中的事件?_C#_Xaml_Listview_Windows Runtime - Fatal编程技术网

C# ListView绑定到集合,如何访问父类中的事件?

C# ListView绑定到集合,如何访问父类中的事件?,c#,xaml,listview,windows-runtime,C#,Xaml,Listview,Windows Runtime,在我的WinRT项目中,我有一个列表视图,如下所示 <ListView Grid.Row="1" ItemsSource="{Binding Path=Survey.SelectedSection.QuestionsAndNavigation, Mode=TwoWay}" IsSwipeEnabled="False" SelectionMode="None" ScrollViewer.VerticalScrollBarVisibility="Auto"

在我的WinRT项目中,我有一个列表视图,如下所示

<ListView Grid.Row="1"
    ItemsSource="{Binding Path=Survey.SelectedSection.QuestionsAndNavigation, Mode=TwoWay}"
    IsSwipeEnabled="False"
    SelectionMode="None"
    ScrollViewer.VerticalScrollBarVisibility="Auto"
    Background="White"
    ItemTemplateSelector="{StaticResource ResourceKey=QuestionDisplay}"
    ItemContainerStyle=
        "{StaticResource ResourceKey=QuestionListViewItemContainerStyle}">
</ListView>
不转到SurveyPageViewModel,我无法在QuestionViewModel类中设置NavService,因为它不在该类中,而是SurveyPageViewModel中的一个属性

编辑。 感谢Eric的回答,我的ListView包含一个x:Name=“ListResponses”。我在按钮路径中使用此选项:

<StackPanel Orientation="Horizontal" >
    <Button Margin="0,40,40,0"
        IsEnabled="{Binding Path=PreviousSectionId, 
            Converter={StaticResource ResourceKey=IntBooleanConverter}}"
        Command="{Binding 
            Path=DataContext.SaveThenPreviousSectionCommand,
            ElementName=ListResponses}">&lt;&lt; Previous Section</Button>
    <Button Margin="0,40,0,0"
            IsEnabled="{Binding Path=NextSectionId, 
                Converter={StaticResource ResourceKey=IntBooleanConverter}}"
            Command="{Binding  
                Path=DataContext.SaveThenNextSectionCommand,
                ElementName=ListResponses}">Next Section &gt;&gt;</Button>
</StackPanel>
。。。 (在构造函数中)

编辑:这是页面的完整XAML文件

<prism:VisualStateAwarePage x:Class="M.Survey.Views.SurveyPage"

                            x:Name="pageRoot"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:views="using:M.Survey.Views"
                            xmlns:local="using:M.Survey"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
                            xmlns:mvvm="using:Microsoft.Practices.Prism.Mvvm"
                            mvvm:ViewModelLocator.AutoWireViewModel="true"
                            xmlns:userControls="using:M.Survey.UserControls"
                            mc:Ignorable="d"
                            xmlns:converters="using:M.Survey.Converters"
                            Loaded="pageRoot_Loaded"
                            Unloaded="pageRoot_Unloaded"
                            xmlns:templateSelectors="using:M.Survey.TemplateSelectors">

    <prism:VisualStateAwarePage.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/AllQuestionDataTemplates.xaml" />
                <ResourceDictionary Source="/Themes/Styles.xaml" />
                <ResourceDictionary Source="/Themes/DataTemplates.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <templateSelectors:QuestionTemplateSelector x:Key="QuestionDisplay"
                TextEntry="{StaticResource TextEntry}"
                DateTimeEntry="{StaticResource DateTimeEntry}"
                BoolEntry="{StaticResource BoolEntry}"
                IntEntry="{StaticResource IntEntry}"
                SelectEntry="{StaticResource SelectEntry}"
                DecimalEntry="{StaticResource DecimalEntry}"
                LargeTextArea="{StaticResource LargeTextArea}"
                SorEntry="{StaticResource SorEntry}"
                Additional="{StaticResource AdditionalEntry}"
                Miscellaneous="{StaticResource Miscellaneous}"
                Dim="{StaticResource Dim}"
                Signature="{StaticResource Signature}"
                SectionNavigation="{StaticResource SectionNavigation}"/>

            <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
            <converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />

        </ResourceDictionary>

    </prism:VisualStateAwarePage.Resources>

    <Grid>
        <Grid.Background>
            <SolidColorBrush Color="{StaticResource ResourceKey=AppBackgroundColor}" />
        </Grid.Background>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="80" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" Background="{StaticResource ResourceKey=MulalleyBlueBrush}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel Orientation="Horizontal" Margin="20, 0, 0, 5">
                    <Button Margin="0, 0, 15, 0" Command="{Binding Path=TryGoHomeCommand}" Style="{StaticResource BackButtonStyle}" />
                    <TextBlock Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Text="{Binding Path=Job.ShortDisplayAddress}" VerticalAlignment="Bottom" />

                    <StackPanel Margin="40, 0, 0, 6" Width="30" VerticalAlignment="Bottom" Height="30">
                        <ProgressRing Height="30" Width="30" Foreground="White" IsActive="{Binding Path=WorkInProgress}" Visibility="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=BooleanToVisibilityConverter}}" />
                    </StackPanel>
                    <TextBlock Margin="10, 0, 0, 10" VerticalAlignment="Bottom" Text="{Binding Path=FeedbackMsg}" Style="{StaticResource ResourceKey=SmallHeaderTextBlockStyle}" />

                </StackPanel>

                <Grid Margin="0, 0, 15, 5" Grid.Column="1" VerticalAlignment="Bottom">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock VerticalAlignment="Bottom" Text="Internet" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" />
                        <TextBlock Margin="10, 0, 15, 6" VerticalAlignment="Bottom" Grid.Column="1" Text="{Binding Path=ConnectionStatus}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />

                        <TextBlock VerticalAlignment="Bottom" Text="Server" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Grid.Column="2" />
                        <TextBlock Margin="10, 0, 15, 6" VerticalAlignment="Bottom" Grid.Column="3" Text="{Binding Path=VpnStatus}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />

                        <TextBlock VerticalAlignment="Bottom" Text="User" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Grid.Column="4" />
                        <TextBlock Margin="10, 0, 0, 6" VerticalAlignment="Bottom" Grid.Column="5" Text="{Binding Path=User.DisplayName}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />
                    </Grid>

                    <TextBlock Width="80" Margin="100, 0, 30, 0" Text="{Binding Path=AnswersCompleteDisplay}" Grid.Column="1" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}"/>

                    <Button Style="{StaticResource ResourceKey=SaveButtonStyle}" Content="Save" Grid.Column="2" Command="{Binding Path=SaveCommand}"  />
                </Grid>
            </Grid>

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>

                <Grid>
                    <Grid.Background>
                        <SolidColorBrush Color="{StaticResource ResourceKey=MulalleyBlue}" Opacity=".2" />
                    </Grid.Background>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <ListView
                        ItemsSource="{Binding Path=Survey.Sections, Mode=TwoWay}"
                            SelectedItem="{Binding Path=Survey.SelectedSection, Mode=TwoWay}"
                            IsSwipeEnabled="False"
                            SelectionMode="Single"
                            ItemContainerStyle="{StaticResource ResourceKey=ListViewItemContainerStyle}"
                            ItemTemplate="{StaticResource ResourceKey=SurveySectionDataTemplate}"
                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            />
                </Grid>

                <Grid Grid.Column="1" Margin="30, 30, 15, 20">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Orientation="Horizontal">
                            <TextBlock Text="*" FontSize="40" FontWeight="Bold" Foreground="Red"/>
                            <TextBlock Text=" = Required " FontSize="20"/>
                        </StackPanel>
                        <ListView 
                            x:Name="ListResponses"
                            Grid.Row="1"
                            ItemsSource="{Binding Path=Survey.SelectedSection.QuestionsAndNavigation, Mode=TwoWay}"
                            IsSwipeEnabled="False"
                            SelectionMode="None"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            Background="White"
                            ItemTemplateSelector="{StaticResource ResourceKey=QuestionDisplay}"
                            ItemContainerStyle=
                                "{StaticResource ResourceKey=QuestionListViewItemContainerStyle}">
                        </ListView>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>

        <userControls:SurveyDialogUserControl />
        <userControls:SurveyReassignedDialogUserControl />
        <userControls:CopyFromUserControl />

    </Grid>

    <prism:VisualStateAwarePage.BottomAppBar>
        <CommandBar Name="commandBar">
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="Settings" Icon="Setting" Click="AppBarButton_Click" />
                <AppBarButton Label="Log" Icon="Admin" Click="LogButton_Click" />
                <AppBarButton Label="Refresh" Icon="Refresh" Command="{Binding Path=RefershAllDataCommand}" IsEnabled="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=InverseBooleanConverter}}" Visibility="{Binding Path=VpnOnline, Converter={StaticResource ResourceKey=BooleanToVisibilityConverter}}" />
                <AppBarButton Label="Copy From" Icon="Copy" Click="CopyButton_Click" Command="{Binding Path=ShowCopyFromCommand}" IsEnabled="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=InverseBooleanConverter}}" />
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </prism:VisualStateAwarePage.BottomAppBar>


</prism:VisualStateAwarePage>

这是用户控件XAML

<UserControl
    x:Class="M.Survey.UserControls.SectionNavigation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:M.Survey.UserControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="using:M.Survey.Converters"
    mc:Ignorable="d"
    d:DesignHeight="30"
    d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <converters:IntBooleanConverter x:Key="IntBooleanConverter" />
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>

        <StackPanel Orientation="Horizontal" >
            <Button Margin="0,40,40,0"
                IsEnabled="{Binding Path=PreviousSectionId, 
                    Converter={StaticResource ResourceKey=IntBooleanConverter}}"
                Command="{Binding 
                    Path=DataContext.SaveThenPreviousSectionCommand,
                    ElementName=ListResponses}">&lt;&lt; Previous Section</Button>
            <Button Margin="0,40,0,0"
                    IsEnabled="{Binding Path=NextSectionId, 
                        Converter={StaticResource ResourceKey=IntBooleanConverter}}"
                    Command="{Binding  
                        Path=DataContext.SaveThenNextSectionCommand,
                        ElementName=ListResponses}">Next Section &gt;&gt;</Button>
        </StackPanel>

    </Grid>
</UserControl>

上一节
下一节

假设ListView XAML与按钮XAML位于同一文件中(并且ListView是x:Name=“ListView”):

保存并保存下一节
此外,还可以在实例化时将调查视图模型的实例传递到问题视图模型中(取决于创建视图模型的方式)


最后,您还可以使用事件发布系统(例如MVVM Light Messenger)在点击按钮时发布事件,该按钮是调查的响应按钮。

我在从Eric那里得到答案方面得到了很大帮助,Eric是给出另一个答案的人。
为了在嵌入到自己复杂设计中的两个类之间进行通信,一种方法是使用EventAggregator模式。碰巧,我正在开发的应用程序使用Prism作为自己的EventAggregator实现。此模式使您能够发布由接收类上的subscribe事件拾取的有效负载。

我确信您的答案是正确的,但我无法将其连接起来。当我点击按钮时,什么也没发生。顺便说一句,我对ViewModel树的看法是错误的。SurveyPageViewModel包含1个SurveyViewModel,其中包含1个SelectedSection,其中包含一组QuestionViewModel对象。命令事件位于SurveyPageViewModel类上。因此,对我来说有意义的是,在识别ListView的名称时,然后在按钮“Path=DataContext.DESIRED_COMMAND”中。该按钮位于UserControl文件中,与LIstView不在同一文件中。这就是问题所在吗?顺便说一下,将SurveyPageViewModel的引用传递给QuestionViewModel将创建一个循环引用,因此我认为这不起作用。我不熟悉MVVM Light Messenger。我查过了,但它看起来很复杂(我是XAML新手),我已经更新了答案,这样你就可以看到我做了什么。你可以发布完整的XAML文件,这样我就可以看到哪些项在彼此的作用域中了吗?好的。我原以为ListView和按钮在同一个范围内(或者至少在文件中)。XAML ElementName绑定无法工作。我的最佳建议是使用类似MVVM Light Messenger类()的发布订阅。
public ICommand SaveThenPreviousSectionCommand { get; private set; }
public ICommand SaveThenNextSectionCommand { get; private set; }
SaveThenPreviousSectionCommand = new DelegateCommand(DoSaveThenPreviousSection);
        SaveThenNextSectionCommand = new DelegateCommand(DoSaveThenNextSection);
   private async void DoSaveThenPreviousSection()
    {
        var i = 1;
    }

    private async void DoSaveThenNextSection()
    {
        var i = 0;
    }
<prism:VisualStateAwarePage x:Class="M.Survey.Views.SurveyPage"

                            x:Name="pageRoot"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:views="using:M.Survey.Views"
                            xmlns:local="using:M.Survey"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
                            xmlns:mvvm="using:Microsoft.Practices.Prism.Mvvm"
                            mvvm:ViewModelLocator.AutoWireViewModel="true"
                            xmlns:userControls="using:M.Survey.UserControls"
                            mc:Ignorable="d"
                            xmlns:converters="using:M.Survey.Converters"
                            Loaded="pageRoot_Loaded"
                            Unloaded="pageRoot_Unloaded"
                            xmlns:templateSelectors="using:M.Survey.TemplateSelectors">

    <prism:VisualStateAwarePage.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/AllQuestionDataTemplates.xaml" />
                <ResourceDictionary Source="/Themes/Styles.xaml" />
                <ResourceDictionary Source="/Themes/DataTemplates.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <templateSelectors:QuestionTemplateSelector x:Key="QuestionDisplay"
                TextEntry="{StaticResource TextEntry}"
                DateTimeEntry="{StaticResource DateTimeEntry}"
                BoolEntry="{StaticResource BoolEntry}"
                IntEntry="{StaticResource IntEntry}"
                SelectEntry="{StaticResource SelectEntry}"
                DecimalEntry="{StaticResource DecimalEntry}"
                LargeTextArea="{StaticResource LargeTextArea}"
                SorEntry="{StaticResource SorEntry}"
                Additional="{StaticResource AdditionalEntry}"
                Miscellaneous="{StaticResource Miscellaneous}"
                Dim="{StaticResource Dim}"
                Signature="{StaticResource Signature}"
                SectionNavigation="{StaticResource SectionNavigation}"/>

            <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
            <converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />

        </ResourceDictionary>

    </prism:VisualStateAwarePage.Resources>

    <Grid>
        <Grid.Background>
            <SolidColorBrush Color="{StaticResource ResourceKey=AppBackgroundColor}" />
        </Grid.Background>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="80" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" Background="{StaticResource ResourceKey=MulalleyBlueBrush}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel Orientation="Horizontal" Margin="20, 0, 0, 5">
                    <Button Margin="0, 0, 15, 0" Command="{Binding Path=TryGoHomeCommand}" Style="{StaticResource BackButtonStyle}" />
                    <TextBlock Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Text="{Binding Path=Job.ShortDisplayAddress}" VerticalAlignment="Bottom" />

                    <StackPanel Margin="40, 0, 0, 6" Width="30" VerticalAlignment="Bottom" Height="30">
                        <ProgressRing Height="30" Width="30" Foreground="White" IsActive="{Binding Path=WorkInProgress}" Visibility="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=BooleanToVisibilityConverter}}" />
                    </StackPanel>
                    <TextBlock Margin="10, 0, 0, 10" VerticalAlignment="Bottom" Text="{Binding Path=FeedbackMsg}" Style="{StaticResource ResourceKey=SmallHeaderTextBlockStyle}" />

                </StackPanel>

                <Grid Margin="0, 0, 15, 5" Grid.Column="1" VerticalAlignment="Bottom">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <TextBlock VerticalAlignment="Bottom" Text="Internet" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" />
                        <TextBlock Margin="10, 0, 15, 6" VerticalAlignment="Bottom" Grid.Column="1" Text="{Binding Path=ConnectionStatus}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />

                        <TextBlock VerticalAlignment="Bottom" Text="Server" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Grid.Column="2" />
                        <TextBlock Margin="10, 0, 15, 6" VerticalAlignment="Bottom" Grid.Column="3" Text="{Binding Path=VpnStatus}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />

                        <TextBlock VerticalAlignment="Bottom" Text="User" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}" Grid.Column="4" />
                        <TextBlock Margin="10, 0, 0, 6" VerticalAlignment="Bottom" Grid.Column="5" Text="{Binding Path=User.DisplayName}" Style="{StaticResource ResourceKey=SmallHeaderStyle}" />
                    </Grid>

                    <TextBlock Width="80" Margin="100, 0, 30, 0" Text="{Binding Path=AnswersCompleteDisplay}" Grid.Column="1" Style="{StaticResource ResourceKey=MediumHeaderTextBlockStyle}"/>

                    <Button Style="{StaticResource ResourceKey=SaveButtonStyle}" Content="Save" Grid.Column="2" Command="{Binding Path=SaveCommand}"  />
                </Grid>
            </Grid>

            <Grid Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="2*" />
                </Grid.ColumnDefinitions>

                <Grid>
                    <Grid.Background>
                        <SolidColorBrush Color="{StaticResource ResourceKey=MulalleyBlue}" Opacity=".2" />
                    </Grid.Background>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <ListView
                        ItemsSource="{Binding Path=Survey.Sections, Mode=TwoWay}"
                            SelectedItem="{Binding Path=Survey.SelectedSection, Mode=TwoWay}"
                            IsSwipeEnabled="False"
                            SelectionMode="Single"
                            ItemContainerStyle="{StaticResource ResourceKey=ListViewItemContainerStyle}"
                            ItemTemplate="{StaticResource ResourceKey=SurveySectionDataTemplate}"
                            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            />
                </Grid>

                <Grid Grid.Column="1" Margin="30, 30, 15, 20">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Orientation="Horizontal">
                            <TextBlock Text="*" FontSize="40" FontWeight="Bold" Foreground="Red"/>
                            <TextBlock Text=" = Required " FontSize="20"/>
                        </StackPanel>
                        <ListView 
                            x:Name="ListResponses"
                            Grid.Row="1"
                            ItemsSource="{Binding Path=Survey.SelectedSection.QuestionsAndNavigation, Mode=TwoWay}"
                            IsSwipeEnabled="False"
                            SelectionMode="None"
                            ScrollViewer.VerticalScrollBarVisibility="Auto"
                            Background="White"
                            ItemTemplateSelector="{StaticResource ResourceKey=QuestionDisplay}"
                            ItemContainerStyle=
                                "{StaticResource ResourceKey=QuestionListViewItemContainerStyle}">
                        </ListView>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>

        <userControls:SurveyDialogUserControl />
        <userControls:SurveyReassignedDialogUserControl />
        <userControls:CopyFromUserControl />

    </Grid>

    <prism:VisualStateAwarePage.BottomAppBar>
        <CommandBar Name="commandBar">
            <CommandBar.SecondaryCommands>
                <AppBarButton Label="Settings" Icon="Setting" Click="AppBarButton_Click" />
                <AppBarButton Label="Log" Icon="Admin" Click="LogButton_Click" />
                <AppBarButton Label="Refresh" Icon="Refresh" Command="{Binding Path=RefershAllDataCommand}" IsEnabled="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=InverseBooleanConverter}}" Visibility="{Binding Path=VpnOnline, Converter={StaticResource ResourceKey=BooleanToVisibilityConverter}}" />
                <AppBarButton Label="Copy From" Icon="Copy" Click="CopyButton_Click" Command="{Binding Path=ShowCopyFromCommand}" IsEnabled="{Binding Path=WorkInProgress, Converter={StaticResource ResourceKey=InverseBooleanConverter}}" />
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </prism:VisualStateAwarePage.BottomAppBar>


</prism:VisualStateAwarePage>
<UserControl
    x:Class="M.Survey.UserControls.SectionNavigation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:M.Survey.UserControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="using:M.Survey.Converters"
    mc:Ignorable="d"
    d:DesignHeight="30"
    d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <converters:IntBooleanConverter x:Key="IntBooleanConverter" />
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>

        <StackPanel Orientation="Horizontal" >
            <Button Margin="0,40,40,0"
                IsEnabled="{Binding Path=PreviousSectionId, 
                    Converter={StaticResource ResourceKey=IntBooleanConverter}}"
                Command="{Binding 
                    Path=DataContext.SaveThenPreviousSectionCommand,
                    ElementName=ListResponses}">&lt;&lt; Previous Section</Button>
            <Button Margin="0,40,0,0"
                    IsEnabled="{Binding Path=NextSectionId, 
                        Converter={StaticResource ResourceKey=IntBooleanConverter}}"
                    Command="{Binding  
                        Path=DataContext.SaveThenNextSectionCommand,
                        ElementName=ListResponses}">Next Section &gt;&gt;</Button>
        </StackPanel>

    </Grid>
</UserControl>
<Button Margin="0,40,0,0"
        IsEnabled="{Binding Path=NextSectionId, Converter={StaticResource ResourceKey=IntBooleanConverter}}"
        Command="{Binding ElementName=listView, Path=DataContext.Survey.DESIRED_COMMAND}">Save and Next Section &gt;&gt;</Button>