xaml

WPF with Helix toolkit, animate with code-behind?

邮差的信 提交于 2021-01-29 02:49:36
问题 I am new to WPF, and am trying to build a 3d viewport with helix toolkit. The viewport, grid etc show up as expected, And I add a simple tube. Now, i want to use a new function to update the Transform of the tube, based on user input, but I cannot get it to work. Where am i going wrong here? Thank you. .xaml <UserControl x:Class="WPFUserControl.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http:

WPF with Helix toolkit, animate with code-behind?

不羁的心 提交于 2021-01-29 02:44:04
问题 I am new to WPF, and am trying to build a 3d viewport with helix toolkit. The viewport, grid etc show up as expected, And I add a simple tube. Now, i want to use a new function to update the Transform of the tube, based on user input, but I cannot get it to work. Where am i going wrong here? Thank you. .xaml <UserControl x:Class="WPFUserControl.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http:

Filtered Combobox ItemsSource binding issue

只谈情不闲聊 提交于 2021-01-28 23:15:00
问题 What I'm trying to do : I have 2 comboboxes, a "regular" one, and a filtrable one. On the filtrable combobox ItemsSource is binded to a property of the first combobox SelectedItem . Here is some XAML to demonstrate the relation (I removed some properties): <ComboBox Name="cbx_poche" ItemsSource="{Binding DataContext.ListePoches, ElementName=Main}" SelectedItem="{Binding PocheCible}" /> <controls:FilteredComboBox ItemsSource="{Binding SelectedItem.SupportsEligibles, ElementName=cbx_poche}"

Implement data validation in entity framework code first

扶醉桌前 提交于 2021-01-28 19:49:26
问题 I am using entity framework 6, .Net framework 4 and code first. I am able to get the validation errors by using GetValidationResult method. But I was not able to show the validation message like the one given in the below image. How to achieve this? My Code: <Label Content="Name" /> <Grid Grid.Row="0" Grid.Column="2"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <TextBox x:Name="txtName" Width="200" Margin="8,0,0,0" MaxLength="150" Text="{Binding Path

Binding to a class property in a dictionary in wpf

对着背影说爱祢 提交于 2021-01-28 19:04:25
问题 If one binds to a listbox's ItemsSource to a list type structure such as an ObservableCollection (or any value-only container really) with the type of a class ( List< MyClass> ) one can access the properties of said class. But if one has a Dictionary<long, MyClass> and binds the itemssource to Dictionary.Values one can not access the class properties anymore. So basically this is my XAML <ListBox ItemsSource="{Binding bm.Values}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock

WPF DataTemplate from another assembly

泄露秘密 提交于 2021-01-28 18:44:47
问题 Is it possible to reference DataTemplate which is located in another assembly in DataTemplateSelector. Currently I have something like this: public override DataTemplate SelectTemplate(object item, DependencyObject container) { var element = container as FrameworkElement; if (element != null && item != null && item is BrowserBaseViewModel) { return element.FindResource("BrowserDataTemplate") as DataTemplate; } return null; } But it works only with current assembly. 回答1: Sure, write in your

Xamarin XAML x:Static reference to property in a nested class

限于喜欢 提交于 2021-01-28 14:22:55
问题 I'm writing a mobile app using Xamarin and I have a static class called Strings that wraps my RESX resources. I want to use x:Static to bind to these in my XAML files. This is working if I have a single static class with static properties to bind to. I'm cutting out some comments and other non-essential bits, but it basically looks like this: namespace MyCompany.Resources { public static partial class Strings { public static string LabelUsername { get { return Resources.LabelUsername; } } } }

How do I view a XAML control's default templates and styles without the Visual Studio designer?

一曲冷凌霜 提交于 2021-01-28 13:05:34
问题 According to the Control template documentation on MSDN, the officially-supported way to view a Control's default templates and styles is with Visual Studio's Designer (well, technically the Document Outline , but that only works with the Designer turned on): A fast way to apply themes to your controls is to right-click on a control on the Microsoft Visual Studio Document Outline and select Edit Theme or Edit Style (depending on the control you are right-clicking on). You can then apply an

How do I view a XAML control's default templates and styles without the Visual Studio designer?

◇◆丶佛笑我妖孽 提交于 2021-01-28 13:02:06
问题 According to the Control template documentation on MSDN, the officially-supported way to view a Control's default templates and styles is with Visual Studio's Designer (well, technically the Document Outline , but that only works with the Designer turned on): A fast way to apply themes to your controls is to right-click on a control on the Microsoft Visual Studio Document Outline and select Edit Theme or Edit Style (depending on the control you are right-clicking on). You can then apply an

How do I view a XAML control's default templates and styles without the Visual Studio designer?

倾然丶 夕夏残阳落幕 提交于 2021-01-28 13:01:51
问题 According to the Control template documentation on MSDN, the officially-supported way to view a Control's default templates and styles is with Visual Studio's Designer (well, technically the Document Outline , but that only works with the Designer turned on): A fast way to apply themes to your controls is to right-click on a control on the Microsoft Visual Studio Document Outline and select Edit Theme or Edit Style (depending on the control you are right-clicking on). You can then apply an