Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i hava got a WPF, C# problem. I want to get the combobox value into the calendar

The WPF Code:
  <ComboBox Name="cbWorker" HorizontalAlignment="Left" Margin="96,10,0,0" VerticalAlignment="Top" Width="198"
   ItemsSource="{Binding Path=Companies}" SelectedItem="{Binding Path=Company}"  >
                  </ComboBox>

 <Label Content="{Binding Path=Company}" HorizontalAlignment="Left" Margin="10,6,0,0" VerticalAlignment="Top"/>

<Calendar Name="Kalender" Tag="{Binding Path=Company}" SelectedDatesChanged="Calendar_SelectedDatesChanged" HorizontalAlignment="Left" Margin="10,10,10,10" VerticalAlignment="Top">
                <Calendar.CalendarDayButtonStyle>
                    <Style TargetType="{x:Type CalendarDayButton}">
                        <Setter Property="Background" >
                            <Setter.Value>
                                <MultiBinding Converter="{StaticResource formatterView}">
                                    <Binding Path="Company" />
                                    <Binding Path="Date" />
                                </MultiBinding>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Calendar.CalendarDayButtonStyle>
            </Calendar>


The problem is that the Label shows the right value but the multi binding says {DependencyProperty.UnsetValue} for the ComboBox value.

What I have tried:

The label to show the value but it works and only the multi Binding did not work.
Posted
Updated 18-Aug-16 2:45am

1 solution

I added at the Binding FallbackValue="" and it works
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900