xaml

How can I pass the currently focused element name through a CommandParameter in XAML?

和自甴很熟 提交于 2020-07-23 07:32:00
问题 In my WPF MVVM application I want to be able to undo changes to individual TextBox elements using the Esc key. I've set up a command for this and I want to trigger it through XAML thus: <Window.InputBindings> <KeyBinding Command="{Binding EscKeyCommand}" CommandParameter="{Binding FocusManager.FocusedElement}" Gesture="ESC" /> </Window.InputBindings> The idea is that the CommandParameter passes the ElementName of the currently focussed TextBox (if indeed that's what's in focus) and the

How can I pass the currently focused element name through a CommandParameter in XAML?

自闭症网瘾萝莉.ら 提交于 2020-07-23 07:30:11
问题 In my WPF MVVM application I want to be able to undo changes to individual TextBox elements using the Esc key. I've set up a command for this and I want to trigger it through XAML thus: <Window.InputBindings> <KeyBinding Command="{Binding EscKeyCommand}" CommandParameter="{Binding FocusManager.FocusedElement}" Gesture="ESC" /> </Window.InputBindings> The idea is that the CommandParameter passes the ElementName of the currently focussed TextBox (if indeed that's what's in focus) and the

Why same thickness Lines in Grid show different thickness?

北城余情 提交于 2020-07-22 21:41:30
问题 I have a problem with line's thickness,And I can't figure out what's the reason. I have a stackPanel in which I put in 2 Grid.In each grid,I have two line with same thickness. Code is Here: <StackPanel Width="300" Margin="10" Height="200" VerticalAlignment="Top" Background="LightGray"> <Grid> <Line X1="0" Y1="0" X2="200" Y2="0" Stroke="Red" StrokeThickness="1"/> <Line X1="0" Y1="24" X2="200" Y2="24" Stroke="Red" StrokeThickness="1"/> </Grid> <Grid> <Line X1="0" Y1="0" X2="200" Y2="0" Stroke=

Why same thickness Lines in Grid show different thickness?

丶灬走出姿态 提交于 2020-07-22 21:37:32
问题 I have a problem with line's thickness,And I can't figure out what's the reason. I have a stackPanel in which I put in 2 Grid.In each grid,I have two line with same thickness. Code is Here: <StackPanel Width="300" Margin="10" Height="200" VerticalAlignment="Top" Background="LightGray"> <Grid> <Line X1="0" Y1="0" X2="200" Y2="0" Stroke="Red" StrokeThickness="1"/> <Line X1="0" Y1="24" X2="200" Y2="24" Stroke="Red" StrokeThickness="1"/> </Grid> <Grid> <Line X1="0" Y1="0" X2="200" Y2="0" Stroke=

WPF Datagrid Multiple Row Validation

杀马特。学长 韩版系。学妹 提交于 2020-07-22 05:37:48
问题 Apologies if this question has already been asked, but I have not been able to find an answer to my specific problem. I have a WPF datagrid which is bound to a Collection of objects called Waypoint that implements IDataErrorInfo . Each Waypoint object a set of properties that have DataItem which also implements IDataErrorInfo . Each column in the datagrid is bound to the Value property of the DataItem object, and what I want is for the Waypoint object to be bound to the Row Validation

How can I fix this error at creating new page?

耗尽温柔 提交于 2020-07-20 04:33:12
问题 I have a Xamarin.Forms Project. In this project I already had a blank page but I added a new one, is when the error started showing. The errors that show are: Error XLS0414 The type 'ContentPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. TaskX.Android New.xaml 1 Error XLS0414 The type 'StackLayout' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been

How to change selection highlight colour of a ListBoxItem in UWP?

浪子不回头ぞ 提交于 2020-07-20 03:34:32
问题 I want to change the selection highlight color of a ListBoxItem The split view pane on the left has a ListBox containing the ListBoxItems.The default selection colour is blue and I want to customize it but I'm not able to change it. I couldn't find any property to change the selection highlight color of a ListBoxItem in UWP. 回答1: You can change the style of ListBoxItem to change the selection highlight color.In the style,you should change all the states that contanin ' Selected ' key word to

Replace the Contents inside Azure Storage

好久不见. 提交于 2020-07-18 09:24:04
问题 Is there are any way to replace a file if the same name exists? I can't see any replace method in Azure Storage. Here is my code: var client = new CloudBlobClient( new Uri(" http://sweetapp.blob.core.windows.net/"), credentials); var container = client.GetContainerReference("cakepictures"); await container.CreateIfNotExistsAsync(); var perm = new BlobContainerPermissions(); perm.PublicAccess = BlobContainerPublicAccessType.Blob; await container.SetPermissionsAsync(perm); var blockBlob =

Xamarin Forms Frame Shadow Design

邮差的信 提交于 2020-07-18 05:30:30
问题 I have an Xamarin Content Page with a List. For the ListItems I want something similar to the cardview in Android. Base on what I found that could be accomplished by a Frame. I have this code: <ViewCell> <StackLayout Padding="8" > <controls:CardView HasShadow="True" OutlineColor="LightGray"> <StackLayout Orientation="Vertical" Padding="5"> // Some labels and Buttons </StackLayout> </Frame> </StackLayout> </ViewCell> The CardView has the following code: public class CardView : Frame { public

Drawing simple relation graph in WPF library needed [closed]

心已入冬 提交于 2020-07-16 09:42:28
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 days ago . Improve this question I am searching for a suggestion how to draw relationship graphs. Like this: There are already some libaries and nuget packages discussed here: How to easily draw graphs in WPF? But I tried all WPF compatible ones and they either depend on a software previously