xaml

Get clicked object from ItemsControl and populate Popup with its properties

為{幸葍}努か 提交于 2021-02-02 09:57:17
问题 I've got an ItemsControl which displays objects from a list from my viewmodel. I also have code to display a Popup when the user click on an item in the ItemsControl. However I don't know how to get the actual object from the clicked item to read its properties and display them in the Popup . I've got a Click event handler for the Button (which is used to display my items in the ItemsControl ) and I tried to see in the debugger if the button contains the desired object but apparently it doesn

using of INotifyPropertyChanged

旧时模样 提交于 2021-01-30 09:09:37
问题 Can someone explain me why need to use implementation of INotifyPropertyChanged when using binding in wpf? I can bind properties without implementation of this interface? For example i have code public class StudentData : INotifyPropertyChanged { #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

using of INotifyPropertyChanged

守給你的承諾、 提交于 2021-01-30 09:09:16
问题 Can someone explain me why need to use implementation of INotifyPropertyChanged when using binding in wpf? I can bind properties without implementation of this interface? For example i have code public class StudentData : INotifyPropertyChanged { #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

using of INotifyPropertyChanged

倖福魔咒の 提交于 2021-01-30 09:07:37
问题 Can someone explain me why need to use implementation of INotifyPropertyChanged when using binding in wpf? I can bind properties without implementation of this interface? For example i have code public class StudentData : INotifyPropertyChanged { #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

using of INotifyPropertyChanged

橙三吉。 提交于 2021-01-30 09:07:07
问题 Can someone explain me why need to use implementation of INotifyPropertyChanged when using binding in wpf? I can bind properties without implementation of this interface? For example i have code public class StudentData : INotifyPropertyChanged { #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

Missing icon in Segoe MDL2 Assets font family

[亡魂溺海] 提交于 2021-01-29 19:00:44
问题 I'm trying to create an AppBarButton where the icon property is a FontIcon but the specific icon I want to use is not working; it is showing as a rectangle. I'm creating a UWP app in C# and I'm trying to create a button with the QR Code (Unicode point ED14) icon from the Segoe MDL2 Assets font but when I enter the icon identifier into the Glyph property of the FontIcon element it simply shows the placeholder rectangle as if the font is not installed. Every other icon I have used in my app

Shortcut for theme styling in XAML / UWP

好久不见. 提交于 2021-01-29 18:48:24
问题 Hopefully this isn't a stupid question but I've spent several hours looking for this answer with no results. Basically, I want to be able to control the appearance of hovered and pressed buttons. I've included the code for one of my buttons below. Here are my issues I have other buttons in my UI that I want to be able to assign this same style to I'd rather not copy/paste all this code because if I ever need to change the colors later, I'm screwed The <style> tag doesn't work because it can't

Combo Box Selected Index -1 bound to Collection View Source

六眼飞鱼酱① 提交于 2021-01-29 17:56:45
问题 I've a ComboBox Bound To a CollectionViewSource and I want that by default the selected index should be -1 (Because nothing should be selected) I've set SelectedIndex="-1" and the first item is still selected. Why? My View xaml: <Window.Resources> <CollectionViewSource x:Key="States" Source="{Binding States}"/> <CollectionViewSource x:Key="Cities" Source="{Binding Source={StaticResource States}, Path=Cities}"/> </Window.Resources> <ComboBox SelectedValue="{Binding Person.State}" Width="150"

Binding to a COM Object - Cannot resolve a Property

左心房为你撑大大i 提交于 2021-01-29 17:46:33
问题 I am currently running into some trouble with binding objects to a WPF ListBox. The number of Elements is populated correctly but the Name property cannot be accessed. I get the following error message: System.Windows.Data Error: 40 : BindingExpression path error: 'Name' property not found on 'object' ''__ComObject' (HashCode=17252513)'. BindingExpression:Path=Name; DataItem='__ComObject' (HashCode=17252513); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

Bindable property at ContentPage level

牧云@^-^@ 提交于 2021-01-29 17:43:59
问题 I have a ContentPage where I've created a bindable property, so that I can pass some info from the ViewModel to the class that implements the ContentPage. To make it clearer, the code behind class has new bindable property (ConnectionSettingsEnabled) defined: public partial class ConnectionSettingsPage : ContentPage { public static readonly BindableProperty ConnectionSettingsEnabledProperty = BindableProperty.Create(nameof(ConnectionSettingsEnabled), typeof(bool), typeof