opening window animation like Microsoft security essentials - wpf

I'm working on a project where I need to display notification popups.
http://youtu.be/fweLIzpW6I0?t=52s
Here you see the way I want the notification to display. Microsoft Security Essentials uses a popup-window which grows. I can't find a way to do it like that.
This is the window:
<Window x:Class="AlertDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Notification"
Height="196" Width="400"
ResizeMode="NoResize"
ShowInTaskbar="False"
Topmost="True"
HorizontalAlignment="Right"
VerticalAlignment="Bottom" SizeToContent="WidthAndHeight" Loaded="Window_Loaded" WindowStyle="ToolWindow">
<Grid Name="contentGrid">
</Grid>
</Window>

Related

Some Extended Unicode Characters (e.g., Zodiac Symbols) Displaying Differently between UWP and WPF

Certain extended Unicode characters, among which are the Zodiac symbols, are displaying differently in WPF TextBlocks vs. UWP TextBlocks. In UWP, as well as web browsers (for example, ♑), Toast messages, etc., display the characters with a purple background and white foreground. In WPF, the same characters are displayed with the control's background color and a black foreground. Ideally, the characters in WPF apps should be displayed consistently with the way they are displayed in other apps.
The following are the results of two test apps, one created as UWP and the other created as WPF. No changes were made to any of the other files (App.xaml, etc.), apart from the addition of the TextBlock control as follows:
UWP MainPage.xaml:
<Page x:Class="UwpApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UwpApp1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Height="150" Width="150">
<Grid>
<TextBlock Text="♑" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="48"/>
</Grid>
</Page>
UWP application screen:
WPF MainWindow.xaml:
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="150" Width="150">
<Grid>
<TextBlock Text="♑" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Top" FontFamily="Segoe UI" FontSize="48"/>
</Grid>
</Window>
WPF application screen:
Is anyone aware of an application setting or any other change that can be done to the WPF application so it will display these types of special characters consistently with other applications?

Combo Box touch events not firing in Windows 10 VS2017

Created a test application with a wpf combo box.
Using touch select an item from Combo box,after selecting the item combo box close after a flickering.
This flickering is not observed using mouse clicks.
Following are the specification for Application:
1.Made AllowsTransparency="True" for windows
2.Unchecked "Enable press and hold for right clicking" in Pen and Touch setting
System Specification:
1.Windows 10
2.VS 2017 and .Net framework 4.7
Some search results shows it is a common issue in Windows 10 that when windows is transparent touch events are not firing.
On Windows 10 (1803), all applications lost touch or stylus if a WPF transparent window covers on them
Workaround mentioned in it is not working in our case.(ResizeMode="NoResize") .
Is there any other workaround for this?
Following is my xaml code:
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d" WindowState="Maximized" WindowStyle="None"
Title="MainWindow" Height="800" Width="800" Background="Transparent" AllowsTransparency="True">
<Grid>
<ComboBox Name="cb" Height="50" Width="50">
<ComboBoxItem>A</ComboBoxItem>
<ComboBoxItem>B</ComboBoxItem>
<ComboBoxItem>C</ComboBoxItem>
<ComboBoxItem>D</ComboBoxItem>
<ComboBoxItem>E</ComboBoxItem>
<ComboBoxItem>F</ComboBoxItem>
<ComboBoxItem>G</ComboBoxItem>
</ComboBox>
</Grid>
</Window>

Combo box flickering in Window 10 Touch screen

I am using a WPF Combobox in my Wpf application.
Following are my issue scenario:
1.Open combo box using touch
2.Touch on any item from drop down list
3.Combo box drop down list close after a flickering.
This issue is not there in mouse click.
I made AllowsTransparency="True" for windows
System Specification:
1.Windows 10
2.Visual Studio 2017
3.Unchecked "Enable press and hold for right clicking" in Pen and Touch setting
Following is my Xaml.code:
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d" WindowState="Maximized" WindowStyle="None"
Title="MainWindow" Height="800" Width="800" Background="Transparent" AllowsTransparency="True">
<Grid>
<ComboBox Name="cb" Height="50" Width="50">
<ComboBoxItem>A</ComboBoxItem>
<ComboBoxItem>B</ComboBoxItem>
<ComboBoxItem>C</ComboBoxItem>
<ComboBoxItem>D</ComboBoxItem>
<ComboBoxItem>E</ComboBoxItem>
<ComboBoxItem>F</ComboBoxItem>
<ComboBoxItem>G</ComboBoxItem>
</ComboBox>
</Grid>
</Window>
Please help

Why does this Microsoft.VisualStudio.Imaging.CrispImage does not show anything?

I am trying to create a very simple WPF application to experiment this concept of the Visual Studio Image Service and Catalog.
I don't understand why I cannot seem to be able to show any of the known images (using KnownMonikers) both on the WPF designer or when the app runs.
The image is there. It just does not show anything.
Here's the WPF source code (following exactly the steps described in the MSDN link above):
<Window x:Class="ImageCatalogBrowser.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ImageCatalogBrowser"
xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging"
xmlns:theming="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Imaging"
xmlns:utilities="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
xmlns:catalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<utilities:BrushToColorConverter x:Key="BrushToColorConverter"/>
</Window.Resources>
<Grid>
<StackPanel
Background="White"
VerticalAlignment="Center"
theming:ImageThemingUtilities.ImageBackgroundColor="{Binding Background, RelativeSource={RelativeSource Self}, Converter={StaticResource BrushToColorConverter}}">
<Border BorderThickness="1" BorderBrush="Black" Width="33" Height="33">
<imaging:CrispImage
x:Name="crisp"
Visibility="Visible"
Width="32"
Height="32"
Moniker="{x:Static catalog:KnownMonikers.Save}" />
</Border>
</StackPanel>
</Grid>
</Window>
Can anyone help please?
What's your code-behind doing to initialize the ImageLibrary? If the library cannot find the moniker you're requesting, then it won't display the image.
Make sure when initializing the ImageLibrary you give it the path to the ImageCatalog's .imagemanifest file (in the VS install dir).

Don't understand why the user control we've written doesn't show up in a ModernWindow but does in a window

We're working on a WPF app, using the ModernUI for WPF. And we're also using MVVM Light. We've written some user controls which we intend to bring up in separate windows. Each of the windows are ModernUI's ModernWindow. Whenever we try to bring them up, nothing is shown in the ModernWindow. Out of frustration I thought I'd try doing the same thing in a plain old WPF window. Works perfectly each time. I don't know why it works in a regular WPF window but doesn't work in a ModernWindow. What is wrong???
Here's the XAML for the plain old window:
<Window x:Class="CoreFramework.BozoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:view="clr-namespace:CoreFramework.View"
xmlns:local="clr-namespace:CoreFramework"
mc:Ignorable="d"
Title="Bozo Window" Height="300" Width="300">
<ContentControl Content="{Binding ProductList, Source={StaticResource Locator}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
And here's the XAML for the ModernWindow:
<mui:ModernWindow x:Class="CoreFramework.DataViewWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
xmlns:vm="clr-namespace:CoreFramework.ViewModel"
xmlns:view="clr-namespace:CoreFramework.View"
xmlns:content="clr-namespace:CoreFramework"
Title="BOTS"
ShowInTaskbar="True"
Closing="ModernWindow_Closing">
<ContentControl Content="{Binding Path=ProductList, Source={StaticResource Locator}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
One approach you could use is adding Menu links which is built into the Modern UI framework:
<mui:ModernWindow x:Class="ExampleApp.ExampleWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mui="http://firstfloorsoftware.com/ModernUI"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
Title="Scrum Manager" IsTitleVisible="True" ContentSource="/Views/DefaultUserControl.xaml"
x:Name="mainWindow" MenuLinkGroups="{Binding Groups}"
WindowStartupLocation="CenterScreen" WindowState="Maximized">
<i:Interaction.Triggers>
</i:Interaction.Triggers>
<mui:ModernWindow.TitleLinks>
<mui:Link DisplayName="settings" Source="/Views/SettingsWindow.xaml" />
<mui:Link DisplayName="Sign out" Source="/Infrastructure/Logout.xaml" />
</mui:ModernWindow.TitleLinks>
When a link is clicked, it opens up the 'Source' which would be UserControl xaml files.
See Github for more details:
https://github.com/firstfloorsoftware/mui

Resources