xaml

How do I reuse VisualState, VisualStateGroup and VsualStateManager in shared resource?

我的未来我决定 提交于 2021-02-06 09:31:50
问题 I created many buttons that it use the same VisualStateManager, VisualStateGroup and VisualState in my Windows Phone project. Then, I want to reuse all of them as the shared resources as the other type of an element such as margin, colors etc. But I found only the way to reuse storyboard that it would be better if I can reuse all of the VisualState. Is there solution of the reusable VisualState? 回答1: The solution I found I tested on Windows 10 UWP app, I have tested several options like

How do I open a PDF included in my C# project in a browser window upon link click?

元气小坏坏 提交于 2021-02-05 11:34:26
问题 I have a folder in my project called "Guides" and have added "My Admin Guide.pdf". The relevant xaml: <TextBlock Margin="20,20,0,0" TextWrapping="Wrap"> <Hyperlink x:Name="Documentation_Hyperlink" NavigateUri="/Guides/My Admin Guide.pdf" TargetName="_blank" RequestNavigate="Documentation_Hyperlink_RequestNavigate"> Click Here for the Admin Guide </Hyperlink> </TextBlock> In the code-behind: private void DDI_Documentation_Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) {

How can I reference a resource (png) from a seperate project in the same solution

大兔子大兔子 提交于 2021-02-05 11:31:07
问题 My solution is structured as follows: Class Library (Name = Chess) Images Pawn.png WPF Core 3.1 Project (Name = ChessApp) MainWindow.xaml I want to show the Pawn.png image inside my MainWindow.xaml inide of an image tag. When I have image files inside my WPF project, I can easily reference them by relative path. When the resources are in a different project, I am not able to fix this. My images inside the Image folder a have the build action Resource and are always copied to the output

how to add a reference of a user control in a xaml file which is shared by two projects

笑着哭i 提交于 2021-02-05 11:31:06
问题 I have created a class library(CustomMapControl) in the solution and inside this class library I create a UserControl(MapItemsControl). Now, I added a reference of this class library to both projects (Portogruaro & Trieste). Here is my solution structure. Portogruaro is the main project and has all files, Trieste has almost all the files which Portogruaro have added as a reference. So, the problem is when I tried to use the CustomMapControl and drag and drop it in xaml from toolbox it doenst

Display a page with extended information

ぐ巨炮叔叔 提交于 2021-02-05 11:27:28
问题 I have the following functionality given below: When clicking on details, i want the text that is displayed on the contentview shall be displayed on the new detailspage that is created by push async. How can I send parameters containing the info given in the content, e.g. title, category and description. I have a tap gesture recognizer: <Label.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/> </Label.GestureRecognizers> That then leads to creating a new page

Display a page with extended information

﹥>﹥吖頭↗ 提交于 2021-02-05 11:27:25
问题 I have the following functionality given below: When clicking on details, i want the text that is displayed on the contentview shall be displayed on the new detailspage that is created by push async. How can I send parameters containing the info given in the content, e.g. title, category and description. I have a tap gesture recognizer: <Label.GestureRecognizers> <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/> </Label.GestureRecognizers> That then leads to creating a new page

: 'Cannot animate 'Fill.Color' on an immutable object instance.'

社会主义新天地 提交于 2021-02-05 11:25:08
问题 I'm new to WPF and I'm mm trying to animate a shape to a "Flashing red" color animation in case I get some trigger value. Here is my relevant XAML code: <Rectangle Width="840" Height="40"> <Rectangle.Style> <Style TargetType="Rectangle"> <Setter Property="Fill" Value="{Binding AlertUnit.AlertColor, FallbackValue=LightPink}"> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding AlertUnit.AlertString}" Value="EMERGENCY" > <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard>

: 'Cannot animate 'Fill.Color' on an immutable object instance.'

陌路散爱 提交于 2021-02-05 11:25:08
问题 I'm new to WPF and I'm mm trying to animate a shape to a "Flashing red" color animation in case I get some trigger value. Here is my relevant XAML code: <Rectangle Width="840" Height="40"> <Rectangle.Style> <Style TargetType="Rectangle"> <Setter Property="Fill" Value="{Binding AlertUnit.AlertColor, FallbackValue=LightPink}"> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding AlertUnit.AlertString}" Value="EMERGENCY" > <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard>

WPF OpacityMask weird behavior

旧时模样 提交于 2021-02-05 11:14:47
问题 I think I might have found a bug in WPF, or maybe I just don't fully understand how OpacityMasks work. As you can see on the first image, I have a diamond shaped path and a red circle. My goal is to make everything outside the diamond invisible. It works when the circle is inside the diamond shape, but whenever I move it to one of the corners, or outside the path, the OpacityMask seems to get stretched or distorted as you can see on the second image. My question is how can I make the

WPF OpacityMask weird behavior

泪湿孤枕 提交于 2021-02-05 11:14:30
问题 I think I might have found a bug in WPF, or maybe I just don't fully understand how OpacityMasks work. As you can see on the first image, I have a diamond shaped path and a red circle. My goal is to make everything outside the diamond invisible. It works when the circle is inside the diamond shape, but whenever I move it to one of the corners, or outside the path, the OpacityMask seems to get stretched or distorted as you can see on the second image. My question is how can I make the