English 中文(简体)
UWP Image control size not changing when binding value is changed
原标题:
  • 时间:2023-05-25 03:01:24
  •  标签:
  • xaml
  • uwp

I have an image control with the height and width bound to a property as follows:

<Image x:Name="capturedPhoto" Height="{x:Bind Path=CrosshairHeight, Mode=OneWay}" Width="{x:Bind Path=CrosshairWidth, Mode=OneWay}"/>

And I have number boxes bound to the same properties.

<muxc:NumberBox Value="{x:Bind Path=CrosshairHeight, Mode=TwoWay}" SpinButtonPlacementMode="Inline" Grid.Row="0" Grid.Column="1" />
<muxc:NumberBox Value="{x:Bind Path=CrosshairWidth, Mode=TwoWay}" SpinButtonPlacementMode="Inline" Grid.Row="1" Grid.Column="1" />

When I change the value of the number box at run time, the image size doesn t change.

问题回答

暂无回答




相关问题
How to bind a TabControl to an ObservableCollection in XAML

I have the following line of code in my code-behind class. TabControl.ItemsSource = ((MainWindowViewModel)DataContext).TabItemViewModels; I would like to move this to the XAML file. In brief, ...

Bind to ancestor of adorned element

Here is the case: <DataTemplate x:Key="ItemTemplate" DataType="local:RoutedCustomCommand"> <Button Command="{Binding}" Content="{Binding Text}" ...

FlowDocument Force a PageBreak (BreakPageBefore)

I m using C# to create a FlowDocument and fill it with data within a table. Example: FlowDocument flowDoc = new FlowDocument(); Table table1 = new Table(); flowDoc.Blocks.Add(table1); table1....

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF TreeView binding through XAML

So I have a class structure like this Store Owner Cashier List of Products Product Name Price List of Vendors Company Name Contact Name So there are 4 ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签