1

I have the following lines of XAML:

<extToolkit:BusyIndicator IsBusy="<image source not set>"> <Image Source="{Binding FirstSideImage, Converter={StaticResource bitmapConverter}}" /> </extToolkit:BusyIndicator> 

I would like the BusyIndicator's IsBusy property to depend on the availability of the Image's Source property. So if there is no image source, IsBusy should be true, otherwise false.

Is this somehow possible? I could of course have a separate property in my view model that does the same but I'd like to know if I can derive this directly from the image.

1 Answer 1

1

You could apply a style to the BusyIndicator, assuming that the Image is the Content (i am not familiar with the control):

<extToolkit:BusyIndicator> <extToolkit:BusyIndicator.Style> <Style TargetType="extToolkit:BusyIndicator"> <Setter Property="IsBusy" Value="False" /> <Style.Triggers> <DataTrigger Binding="{Binding Content.Source, RelativeSource={RelativeSource Self}}" Value="{x:Null}"> <Setter Property="IsBusy" Value="True" /> </DataTrigger> </Style.Triggers> </Style> </extToolkit:BusyIndicator.Style> <Image Source="{Binding FirstSideImage, Converter={StaticResource bitmapConverter}}" /> </extToolkit:BusyIndicator> 

You could also directly use the binding in the trigger and apply a converter which turns null into true.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.