xaml

XAML Designer System.Runtime.Remoting.RemotingException

ⅰ亾dé卋堺 提交于 2021-02-17 20:28:58
问题 I'm encountering the following System.Runtime.Remoting.RemotingException error when I create a blank Windows 10 Universal Application... Following are event viewer screens... I have checked online for other solutions and have already done the following... Uninstall/Repair Visual Studio 2015 Update 1 Reset my Windows 10 PC 1511 update Cleared the Designer/ShadowCache folder Target environment has been set to x86/x64 Target framework set to 10240 Developer mode enabled Updated graphic drivers

How to layout scrolling ListBox with auto max height and attach always visible Button below?

╄→尐↘猪︶ㄣ 提交于 2021-02-17 06:31:56
问题 I want a layout where a ListBox is placed at the top of the window and a button is attached to the bottom of the ListBox. When the window is too small I want the ListBox to scroll and the button to be visible. When the window is too large, i.e. enough space for all controls and all list items, I want the ListBox to take up exactly as much space as it needs, and empty space be added below the button. I have tried DockPanel: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas

Fit image to border background

僤鯓⒐⒋嵵緔 提交于 2021-02-17 05:46:12
问题 may i know how can fit the image into the designed border? below are the code that i've done. <Border Grid.Row="1" BorderThickness="1" BorderBrush="LightGreen" Margin="20" CornerRadius="30"> <Border.Background> <LinearGradientBrush EndPoint="0.504,1.5" StartPoint="0.504,0.03"> <GradientStop Color="#F9FFF0" Offset="0"/> <GradientStop Color="#F3FFE2" Offset="0.567"/> </LinearGradientBrush> </Border.Background> <Image Source="/LBKIOSK;component/Resources/Images/Background/klhoho.jpg" Opacity="0

Prism unity container per module

牧云@^-^@ 提交于 2021-02-17 02:38:40
问题 I have two modules in my app, and want to register types for a second module in a separate container. Didn't find any ways to do that. Only way I see now is add prefixes to reusable types like that: var foo1 = new Foo("FOO 1"); parentContainer.RegisterInstance<IFoo>("Foo1", foo1); var foo2 = new Foo("FOO 2"); parentContainer.RegisterInstance<IFoo>("Foo2", foo2); parentContainer.RegisterType<IService1, Service1>(new ContainerControlledLifetimeManager(), new InjectionConstructor(new

Defining a color in App.xaml and using as a static resource

好久不见. 提交于 2021-02-16 20:30:18
问题 EDIT: Looks like this was related to the way I declared the color - using hex value seems to bring it through fine. EDIT: This about referencing from the App.xaml file. The color itself works fine if declared as a local resource. I've created a colour: <SolidColorBrush x:Key="TestBlue"> <SolidColorBrush.Color> <Color R="0" G="86" B="45"/> </SolidColorBrush.Color> </SolidColorBrush> and placed it in a ResourceDictionary. I've then referenced it in a MergedDictionary: <Application.Resources>

Bind to property only if it exists

不打扰是莪最后的温柔 提交于 2021-02-16 16:28:05
问题 I have a WPF window that uses multiple viewmodel objects as its DataContext. The window has a control that binds to a property that exists only in some of the viewmodel objects. How can I bind to the property if it exists (and only if it exists). I am aware of the following question/answer: MVVM - hiding a control when bound property is not present. This works, but gives me a warning. Can it be done without the warning? Thanks! Some example code: Xaml: <Window x:Class="WpfApplication1

Background select item of List View

本秂侑毒 提交于 2021-02-16 15:37:13
问题 I have a page.xaml with a listview. The background color of the page is white and when I tap a ListView item, the background of this item is gray. How can I change this color (of the background selected item) in a cross-platform way? Page.xaml page.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace App1.Materie_Universitarie.Diritto_Commerciale { [XamlCompilation

WPF Heirachical DataTemplate in TreeView

醉酒当歌 提交于 2021-02-16 15:18:30
问题 I am trying to get my head around Heirarchical DataTemplates and TreeViews in WPF and am having some trouble. I have created an app with only a TreeView on the form as below and defined HierarchicalDataTemplate's for both a Directory object and a File object I then Bind the TreeView to the Directories property (ObservableCollection) of my model. <Grid> <Grid.Resources> <HierarchicalDataTemplate DataType="{x:Type local:Directory}" ItemsSource ="{Binding Directories}"> <TextBlock Text="{Binding

Binding to attributes

二次信任 提交于 2021-02-16 04:46:56
问题 I have class public class Car { [Description("name of the car")] public string Name { get; set; } [Description("age of the car")] public int Age { get; set; } } is there any possibility to bind Description attribute to Label content. The solution what I'm looking for shouldn't require to instantiate Class object. 回答1: It won't be a proper binding (which is not necessary for static data anyway) but you can easily create a MarkupExtension to retrieve it, just pass the type and the property name

Binding to attributes

假如想象 提交于 2021-02-16 04:46:27
问题 I have class public class Car { [Description("name of the car")] public string Name { get; set; } [Description("age of the car")] public int Age { get; set; } } is there any possibility to bind Description attribute to Label content. The solution what I'm looking for shouldn't require to instantiate Class object. 回答1: It won't be a proper binding (which is not necessary for static data anyway) but you can easily create a MarkupExtension to retrieve it, just pass the type and the property name