Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
about the Template in the XamTileView
posted

in the XamTileView, we define template for the TilePaneHeaderTemplate, which have a label to show the name & a button to delete this item.

when we just put it in a single project, it can work well. however when we integrate it into a MVVM project, all seems well, but the delete button failed, there is no reply even we just let it pop up a message, we just get Null information during the debug mode.

can anyone give some advice to me or should i provide more information?

 

the XamTileView is as follows,

        <ig:XamTileView Grid.Row="0" UseLayoutRounding="False" x:Name="ImgPreview" MinHeight="400" ItemsSource="{Binding Models, Mode=TwoWay}"
                ColumnsInPage="3"                                     
                RowsInPage="2"
                MaximizedStateChanged="ImagePreview_MaximizedStateChanged"
                   TilePaneHeaderTemplate="{StaticResource CommonPreviewHeader}"
                TilePaneContentTemplate="{StaticResource CommonPreview}"
                PageIndex="{Binding Ipages, Mode=TwoWay}">
        </ig:XamTileView>

the template is as follows,

        <DataTemplate x:Key="CommonPreviewHeader">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button x:Name="btnDeleteImage"  VerticalAlignment="Top" Command="{Binding SaveCommand}"   Grid.Column="0" Content="x"></Button>
                <!--<Button DataContext="{Binding Image_Name}" x:Name="btnDeleteImage" Command="{Binding BtnDelImageCommand}" VerticalAlignment="Top"   Grid.Column="0" Content="x" Visibility="Collapsed">
                </Button>--><!--<Button DataContext="{Binding RealImage}" x:Name="btnDeleteImage" VerticalAlignment="Top"   Grid.Column="0" Content="x">
                    <Interactive:Interaction.Triggers>
                        <Interactive:EventTrigger EventName="Click">
                            <Interactive:InvokeCommandAction x:Name="deleteImage" Command="{Binding Source={StaticResource Images}, Path=BtnDelImageCommand}" CommandParameter="{Binding DataContext, ElementName=btnDeleteImage}"></Interactive:InvokeCommandAction>
                        </Interactive:EventTrigger>
                    </Interactive:Interaction.Triggers>
                </Button>-->                <TextBlock Grid.Column="1" Text="{Binding Original_Image_Name}" FontStretch="Expanded" VerticalAlignment="Center" FontWeight="Black" FontSize="12"/>
            </Grid>
        </DataTemplate>

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but I cannot be completely sure what can casue this issue since I don't know how your model and viewmodel are organized, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.

     

    Feel free to write me if you have further questions.