binding

IDataErrorInfo - not seeing any error message even though one gets picked up

守給你的承諾、 提交于 2020-01-02 09:27:27
问题 I have ItemType that implements everything one would need for Validation with the help of IDataErrorInfo interface: #region IDataErrorInfo implementation //WPF doesn't need this one public string Error { get { return null; } } public string this[string propertyName] { get { return GetValidationError(propertyName); } } #endregion #region Validation public bool IsValid { get { foreach (string property in ValidatedProperties) { if (GetValidationError(property) != null) { return false; } } return

Xamarin Forms - Binding Multiple TextCells in one ListView

我怕爱的太早我们不能终老 提交于 2020-01-02 09:18:23
问题 I am having trouble binding multiple TextCells in a ListView. It works fine if there's only one, but gives XamlParseException on adding more. The same Exception occurs while trying to bind a Label. That's why I had to use a TextCell. What's the solution? <ListView x:Name="pList"> <ListView.ItemTemplate> <DataTemplate> <TextCell x:Name="a" Text="{Binding ReceiverName}" TextColor="White" /> </DataTemplate> </ListView.ItemTemplate> </ListView> 回答1: From your comment on one of the answers, it

WPF Relative source- Cannot find source for binding with reference

白昼怎懂夜的黑 提交于 2020-01-02 08:44:23
问题 have you ever have a problem like this: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.UserControl', AncestorLevel='1''. BindingExpression:Path=DataContext; DataItem=null; target element is 'ContextMenu' (Name=''); target property is 'DataContext' (type 'Object') Code: <ContextMenu DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type

ComboBox IsEnabled Binding Question in Silverlight Xaml

﹥>﹥吖頭↗ 提交于 2020-01-02 08:07:20
问题 I have a ComboBox whose xaml is as follows <ComboBox Name="ComboBoxDiscussionType" IsEnabled="{Binding ElementName=ComboBoxDiscussionType, Path=Items.Count, Converter={StaticResource ComboBoxItemsCountToBoolConverter}}"/> and the converter takes the Items.Count and checks if its greater than 0 if its greater than 0 then enable it else disable it The goal is enable the ComboBox if the ComboBox only if it has Items in it else disable it, ( self Binding to its item.count ) the following is my

How do I correctly wrap native c library in Xamarin.iOS

微笑、不失礼 提交于 2020-01-02 07:29:30
问题 I am trying to bind a native c (not objective c) library to Xamarin.iOS. My project that consists of .c and .h files is building fine in XCode. Actual .h and .m of the project do not contain any functions, I only need to use the c-defined routines. The h file, that contains the required method definition looks like this: #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> int sprec_flac_encode(const char

jQuery date picker not persistant after AJAX

末鹿安然 提交于 2020-01-02 07:03:49
问题 So I'm using the jQuery date picker, and it works well. I am using AJAX to go and get some content, obviously when this new content is applied the bind is lost, I learnt about this last week and discovered about the .live() method. But how do I apply that to my date picker? Because this isn't an event therefore .live() won't be able to help... right? This is the code I'm using to bind the date picker to my input: $(".datefield").datepicker({showAnim:'fadeIn',dateFormat:'dd/mm/yy',changeMonth

Why does binding affect height?

橙三吉。 提交于 2020-01-02 07:00:35
问题 Style definition in Resources/Shared.xaml ( updated ): <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:Double x:Key="fullHeight" >26</system:Double> <system:Double x:Key="halfHeight" >16</system:Double> <Thickness x:Key="m">10</Thickness> <Style TargetType="Button"> <Setter Property="FontSize" Value="{StaticResource fullHeight}"/> <Setter

Binding an attached property to an item in ItemsControl with custom panel problem

本秂侑毒 提交于 2020-01-02 06:23:10
问题 I can't get the following XAML to work as I want. All bindings work because get no errors from the bindings. But I don't get the expected result from the binding on the RatioShape rectangle. The problem is that the attached property wpflib:RatioPanel.Ratio always returns its default value, not the databound value. So I'm thinking that the attached property on RatioShape is set in the wrong "context". How do bind to the attached property so that wpflib:RatioPanel gets the bound value? <wpflib

DependencyProperty value not getting set through data binding

不羁的心 提交于 2020-01-02 05:38:08
问题 I have a class which has a DependencyProperty member: public class SomeClass : FrameworkElement { public static readonly DependencyProperty SomeValueProperty = DependencyProperty.Register( "SomeValue", typeof(int), typeof(SomeClass)); new PropertyMetadata( new PropertyChangedCallback(OnSomeValuePropertyChanged))); public int SomeValue { get { return (int)GetValue(SomeValueProperty); } set { SetValue(SomeValueProperty, value); } } public int GetSomeValue() { // This is just a contrived example

Dynamically created text with clickable links in it via binding

浪尽此生 提交于 2020-01-02 05:35:09
问题 I do want to create a listview which consists of many items of an own class. One of the properties is a text which can contain one or more links in it. Normally I use a textblock with a binding on Text to get this content displayed. Now I do want those text being parsed for links and then dynamically make those links clickable. I found quite some code like Add hyperlink to textblock wpf on how to create a textblock with hyperlinks so I would be fine - but the WPF binding is available on the