。在那個應用程序中,我使用MyToolkit數據網格。我想通過使特定單元格數據在特定情況下閃爍來突出顯示datagrid行。在通用Windows平臺應用程序中的MyToolkit DataGrid中自定義特定的行數據我正在開發Windows應用程序
0
A
回答
1
您可以在您的項目中安裝Microsoft.Xaml.Behaviors.Uwp.Managed。然後使用DataTriggerBehavior
使特定單元數據在特定情況下閃爍。
首先,你需要使用這個包是這樣的:
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
xmlns:Media="using:Microsoft.Xaml.Interactions.Media"
再比如說,你可以設計的DataGrid
這樣的細胞:
<controls:DataGridTemplatedColumn Width="0.7*" CanSort="False" Header="LastName">
<controls:DataGridTemplatedColumn.CellTemplate>
<DataTemplate>
<Grid Height="30">
<Grid.Resources>
<Storyboard x:Key="std" x:Name="std">
<ColorAnimation From="Red" To="Blue" Duration="0:0:3" RepeatBehavior="Forever" AutoReverse="True"
Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)"
Storyboard.TargetName="lastnamePanel" />
</Storyboard>
</Grid.Resources>
<StackPanel Name="lastnamePanel" Background="AliceBlue">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding Lastname}" ComparisonCondition="Equal" Value="Mike">
<Media:ControlStoryboardAction Storyboard="{StaticResource std}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<TextBlock x:Name="lastnameTxt" Text="{Binding Lastname}" TextAlignment="Center" VerticalAlignment="Center" Margin="0,5,0,0"></TextBlock>
</StackPanel>
</Grid>
</DataTemplate>
</controls:DataGridTemplatedColumn.CellTemplate>
</controls:DataGridTemplatedColumn>
當lastnameTxt
的Text
不等於「Mike」,那麼將會播放Storyboard
。這裏是繪製圖像:
這是你需要照顧的一點是,初始Background
應設置爲lastnamePanel
,否則故事板將不會播放。
相關問題
- 1. 在tiapp.xml中定義平臺特定的應用程序ID?
- 2. 爲Windows開發應用程序:使用什麼開發平臺?
- 3. Windows App Studio應用程序在VS 2013中開始自定義
- 4. 在通用Windows平臺(UWP)應用程序中使用DESCryptoServiceProvider
- 5. 在Windows 8應用程序中使用SharpDX XAudio2自定義XAPO應用程序
- 6. 自定義TraceListener Windows應用程序
- 7. 如何在Windows平臺上開發Iphone應用程序(Xp,Vista)
- 8. 如何在Windows平臺上開發iOS應用程序?
- 9. 如何在Windows Azure平臺上開發Facebook應用程序?
- 10. 在Windows 8.1中開發Windows應用程序,如OneDrive應用程序
- 11. 創建自定義形狀在UWP(通用的Windows應用程序)時,Windows 10
- 12. 應用程序在Windows Phone 8中的應用程序通信
- 13. 如何更新通用Windows平臺應用程序中的一個特定的dotnet程序集?
- 14. 在Windows窗體應用程序中顯示數據表中的特定行
- 15. 如何在我的應用程序中打開特定的應用程序?
- 16. Windows Phone 8.1應用程序中預定義的數據庫
- 17. 如何在Windows中開發通用應用程序
- 18. 佈局conrols開發通用應用程序在Windows 8.1中
- 19. 在Windows 10通用應用程序上檢查平臺
- 20. 在Windows Phone應用程序中自定義單選按鈕
- 21. SDK在Windows iphone應用程序開發
- 22. windows azure雲平臺mvc應用程序
- 23. 通用Windows平臺應用程序編碼XML中的特殊字符應用程序
- 24. Windows 10通用應用程序自定義地圖
- 25. 特定的應用程序開發
- 26. 如何擦除通用Windows平臺(Windows 10)應用程序中的InkCanvas筆劃?
- 27. 如何使用Facebook應用程序指定Windows桌面平臺
- 28. 通用Windows平臺(UWP)C#應用程序 - 如何在您的應用程序內運行獨立的Python
- 29. Windows通用應用程序中的TaskbarItemInfo
- 30. 在通用的Windows應用程序
可能的重複http://stackoverflow.com/questions/14647556/conditional-formatting-of-wpf-datagrid-cell-depending-on-datatype –
這不能是WPF和UWP。請顯示代碼,目前還不清楚你在問什麼 –