verbon / winrtmultibinding Goto Github PK
View Code? Open in Web Editor NEWProvides MultiBinding functionality for Windows 8.1 and Windows Phone 8.1 projects.
Provides MultiBinding functionality for Windows 8.1 and Windows Phone 8.1 projects.
When using the MV-converter in an UWP ListBox control everything works fine.
However, I switched to using a ListView where an "empty placeholder rectangle" is used in the virtualization mechanism the short time the actual ListViewItem (with it's binded data) is loaded. This is to make e.g. scrolling smoother. But then I get the following exception:
Exception {System.NullReferenceException: Object reference not set to an instance of an object.
at System.Object.GetType()
at WinRTMultibinding.Foundation.Data.Binding.CheckIfBindingModeIsValid(Object source, String path, BindingMode mode)
at WinRTMultibinding.Foundation.Data.Binding.SetBinding(Object source, Boolean shouldRaiseOnSourcePropertyValueChanged)
at WinRTMultibinding.Common.Extensions.CollectionExtensions.ForEach[T](IEnumerable1 source, Action
1 action) ....
Well somehow it's logical, since the actual source that's going into the converter isn't loaded yet.
Any idea how to get around or solve this?
Trying to set UpdateSourceTrigger="Explicit" in order to prevent converter to run until source is loaded didn't help.
Many thanks.
<TextBlock x:Name="txtContentMessage" Text="{Binding Text}" TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" Foreground="{Binding Entities,ConverterParameter={Binding Text},Converter={StaticResource ChangedColorToUrlConverter},Mode=TwoWay}" MaxLines="3" Grid.Row="1"></TextBlock>
When I see your code:
<TextBlock x:Name="txtContentMessage" Text="{Binding Text}" TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" MaxLines="3" Grid.Row="1">
<m:MultiBindingHelper.MultiBindings>
<m:MultiBindingCollection>
<m:MultiBinding TargetProperty="Text">
<m:Binding ConverterParameter="{Binding Text}" Converter="{StaticResource ChangedColorToUrlConverter}"></m:Binding>
<m:Binding ConverterParameter="{Binding Entities}" Converter="{StaticResource ChangedColorToUrlConverter}"></m:Binding>
</m:MultiBinding>
</m:MultiBindingCollection>
</m:MultiBindingHelper.MultiBindings>
</TextBlock>
And application has broken up when it was running.
Any chance this could be update to support Windows 10 UWA.
Thanks for a great package :)
For example, multibinding to Canvas.Left property.
In SLMultiBinding it was done as
``
if (relay.TargetProperty.Contains("."))
{
// split to find the type and property name
string[] parts = relay.TargetProperty.Split('.');
targetType = Type.GetType("System.Windows.Controls." + parts[0] +
", System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e");
targetProperty = parts[1];
}
else
{
targetType = targetElement.GetType();
targetProperty = relay.TargetProperty;
}
FieldInfo[] sourceFields = targetType.GetFields(DpFlags);//.OrderByDescending(x => x.Name).ToArray();
FieldInfo targetDependencyPropertyField =
sourceFields.First(i => i.Name == targetProperty + "Property");
DependencyProperty targetDependencyProperty =
targetDependencyPropertyField.GetValue(null) as DependencyProperty;
// bind the ConvertedValue of our MultiBinding instance to the target property
// of our targetElement
Binding binding = new Binding("ConvertedValue")
{
Source = relay,
Mode = relay.Mode
};
targetElement.SetBinding(targetDependencyProperty, binding);
``
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.