Ghost1372

everything can be handy

ForegroundFocusEffects

Property

Name
Content
Effect
MaskSource
ApplyEffectDuration
RemoveEffectDuration
ShowAnimationDuration
HideAnimationDuration

Method

Name
RemoveEffect
ApplyEffect

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<dev:ForegroundFocusEffects x:Name="ForegroundFocusEffectsSample"
Effect="Blur">
<ListView IsItemClickEnabled="True"
ItemClick="OnItemClick"
ItemsSource="{x:Bind ViewModel.SampleImageAndTextData, Mode=OneWay}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate x:DataType="model:SampleData">
<Grid>
<Image Width="140"
Height="140"
Source="{x:Bind ImageUrl}"
Stretch="UniformToFill" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</dev:ForegroundFocusEffects>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
private async void OnItemClick(object sender, ItemClickEventArgs e)
{
var item = (SampleData)e.ClickedItem;

ForegroundFocusEffectsSample.ApplyEffect();

ContentDialog contentDialog = new ContentDialog
{
XamlRoot = this.XamlRoot,
Title = item.Name,
Content = item.Description,
PrimaryButtonText = "OK",
CloseButtonText = "Cancel",
DefaultButton = ContentDialogButton.Primary
};
contentDialog.PrimaryButtonClick += ContentDialog_PrimaryButtonClick;
contentDialog.CloseButtonClick += ContentDialog_PrimaryButtonClick;
await contentDialog.ShowAsyncQueue();
}

private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
ForegroundFocusEffectsSample.RemoveEffect();
}

DevWinUI

Demo

you can run demo and see this feature.

0%