multibinding

Multibinding not working on TextBox.Text

谁都会走 提交于 2019-12-13 02:34:17
问题 I have a MultiBinding that is not working on TextBox.Text. I have the same code that is binding properly to Value of Extended WPF Toolkit's IntegerUpDown. It is going through an IMultiValueConverter that takes the bound POCO and the listbox it is part of (it is displaying the order of the item in the listbox) Here is the code: <!--works--> <wpf:IntegerUpDown ValueChanged="orderChanged" x:Name="tripOrder"> <wpf:IntegerUpDown.Value> <MultiBinding Converter="{StaticResource listBoxIndexConverter

Keep getting error: The tag does not exist in XML namespace

孤人 提交于 2019-12-13 00:48:39
问题 I have a project that test Multibinding. I want binding data from textBox2 and textBox3 to textBox1. I tried again and again but still got error. XAML: <Window x:Class="Test_Multibiding.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="621" xmlns:c="clr-namespace:Test_Multibiding"> <Window.Resources> <c:StringFormatConverter x:Key="StrConverter"/> </Window.Resources> <Grid

Problem with validation and multibinding

南笙酒味 提交于 2019-12-12 14:29:03
问题 In my WPF application I use the following xaml: ... <TextBox services:TextBoxService.IsFocused="{Binding Path=IsSelected, Mode=OneWay}" FocusVisualStyle="{x:Null}"> <MultiBinding Converter="{StaticResource mconv_operableToString}" UpdateSourceTrigger="PropertyChanged"> <Binding Path="Value" Mode="TwoWay" NotifyOnValidationError="True" /> <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" Path="DataContext.Status" Mode="OneWay" /> </MultiBinding> The

Multibinding as resource in XAML

♀尐吖头ヾ 提交于 2019-12-12 07:17:17
问题 Is it possible (if yes how), to add multivaluebinding expression into resource. I have a Multivalue binding, that takes 2 separate binding, and converter parameter in one of those binding. I have to use this binding to 5 Different items, and those binding tags differ only in converter parameter. Rest everything is same. I would to avoid repetition of multibinding boilerplate tags. 回答1: Easy way of seeing if something works: TRY IT! <Style TargetType="Button"> <Setter Property="Content">

WPF ListBox with multiple sources of different types

Deadly 提交于 2019-12-12 04:47:08
问题 I was actually setting up a sample application for something entirely different, but then I was trying this: I have a collection of Movies . I'll have a list box which displays all the movies. The list box, however, provides them as buttons, so that you can click onto a button and play the movie. The code is: <StackPanel DockPanel.Dock="Top"> <ListBox ItemsSource="{Binding Movies}" SelectedItem="{Binding Path=SelectedMovie}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost=

Multibind not working in XAML/WPF

风格不统一 提交于 2019-12-12 03:07:33
问题 I need to calculate the width of an ItemsControl WPF item, however I need to pass not one but two parameters. Here is what it looks like: <ItemsControl.Width> <MultiBinding Converter="{StaticResource animationKeyPositionConverter}"> <Binding Path="CurrentFrame" ElementName="UC" /> <Binding Path="CurrentZoom" ElementName="UC" /> </MultiBinding> </ItemsControl.Width> The converter looks like: internal class AnimationKeyPositionConverter : IMultiValueConverter { public object Convert(object[]

WPF MultiBinding VS designer exception

随声附和 提交于 2019-12-11 09:31:43
问题 Visual Studio 2010 designer says that unhandled exception occurred in MultiValueConverter but I can build my program and it works fine (multibinding also works). XAML (I set window.DataContext in constructor): <ComboBox Name="cbbProfile" DisplayMemberPath="Name" Grid.Row="1" Margin="10,5" Grid.ColumnSpan="3" ItemsSource="{Binding ProfilesData.ProfilesItems}" SelectionChanged="cbbProfile_SelectionChanged" > <ComboBox.IsEnabled> <MultiBinding Converter="{StaticResource multiEnabledToEnabled}">

MultiBinding with binding StringFormat

為{幸葍}努か 提交于 2019-12-11 07:57:27
问题 I am trying to display some label with MultiBinding with Binding on StringFormat. Like that: <Label.Content> <TextBlock> <TextBlock.Text> <MultiBinding StringFormat="{Binding LabelStringFormat, Source={DynamicResource Texts}}"> <Binding Path="Lib1" /> <Binding Path="Lib2" /> </MultiBinding> </TextBlock.Text> </TextBlock> </Label.Content> LabelStringFormat can be something like "[{0}/{1}]" or something like that. It is known in build but must be used from Resource. But when I use something

MultiBinding StringFormat of TimeSpan

五迷三道 提交于 2019-12-11 05:22:53
问题 I cannot for the life of me get this to work. I need to display hh:mm from a pair of timespan objects in a textblock and it is just not working. This is what I have so far: <TextBlock> <TextBlock.Text> <MultiBinding StringFormat="{}From {0:hh\\:mm} to {1:hh\\:mm}"> <Binding Path="StartTime"/> <Binding Path="EndTime"/> </MultiBinding> </TextBlock.Text> </TextBlock> The text block shows up blank. I've also tried the following with the same results: <TextBlock> <TextBlock.Text> <MultiBinding

What hardware/platform difference could cause an XAML-WPF multibinding to CheckBox to fail?

穿精又带淫゛_ 提交于 2019-12-11 04:40:16
问题 This is a follow up to my last question (see code example there and my last comment on the accepted answer). In short, I've got a Multibinding on a WPF DataGridTextColumn to a (home-grown) Person object and a CheckBox . On several computers that I have in the office, it works as expected - the content is altered based on the state of the CheckBox according to my object that implements the IMultiValueConverter interface - but on all four computers tested (so far) in the field, it fails. The