Hi Guys,
I got style loading inconsistently in ArcGIS Pro , combobox.
For example that combobox :
Loaded correctly with the following code.
<ComboBox Background="{DynamicResource Esri_BackgroundPressedBrush}" Foreground="{DynamicResource Esri_TextStyleEmphasisBrush}" IsEditable="False" Grid.Row="0" Grid.Column="1" SelectedValue="{Binding Path=InputModel.Delimiter}" SelectedValuePath="Tag" >
<ComboBoxItem Tag=",">Comma</ComboBoxItem>
<ComboBoxItem Tag=" ">Space</ComboBoxItem>
<ComboBoxItem Tag=" ">MultiSpace</ComboBoxItem>
<ComboBoxItem Tag="\t">Tab</ComboBoxItem>
<ComboBoxItem Tag=":">Colon</ComboBoxItem>
<ComboBoxItem Tag="?">Other</ComboBoxItem>
</ComboBox>
However, If I load dynamically with style edit based on mvvm binding. with same background and foreground style. I got different result.
<ComboBox Background="{DynamicResource Esri_BackgroundPressedBrush}" Foreground="{DynamicResource Esri_TextStyleEmphasisBrush}"
Grid.Row="8" Grid.Column="1" SelectedItem="{Binding Path=InputModel.LongIndex, Mode=TwoWay}" SelectedValuePath="Tag"
ItemsSource="{Binding Path=ColumnCount, Mode=TwoWay}" >
<ComboBox.Style>
<Style TargetType="{x:Type ComboBox}">
<Setter Property="IsEnabled" Value="False">
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=InputModel.DataReady}" Value="True">
<Setter Property="IsEnabled" Value="True" />
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
Do I need something to make it work or is that bug?
Best Regards,
Than
Solved! Go to Solution.
Hi Guys,
Managed to get workaround without using style trigger.
I just directly bind with the properties through viewmodel, for those with visibility which is not default string format.
I create the new variable with visibility data type. That way solve for me at the moment.
<ComboBox Background="{DynamicResource Esri_BackgroundPressedBrush}" Foreground="{DynamicResource Esri_TextStyleEmphasisBrush}"
IsEditable="False" Grid.Row="8" Grid.Column="1" SelectedItem="{Binding Path=BatchUploadModel.LatIndex}"
SelectedValuePath="Tag"
ItemsSource="{Binding Path=ColumnCount, Mode=TwoWay}" IsEnabled="{Binding Path=BatchUploadModel.DataReady}">
</ComboBox>
Hi Guys,
Managed to get workaround without using style trigger.
I just directly bind with the properties through viewmodel, for those with visibility which is not default string format.
I create the new variable with visibility data type. That way solve for me at the moment.
<ComboBox Background="{DynamicResource Esri_BackgroundPressedBrush}" Foreground="{DynamicResource Esri_TextStyleEmphasisBrush}"
IsEditable="False" Grid.Row="8" Grid.Column="1" SelectedItem="{Binding Path=BatchUploadModel.LatIndex}"
SelectedValuePath="Tag"
ItemsSource="{Binding Path=ColumnCount, Mode=TwoWay}" IsEnabled="{Binding Path=BatchUploadModel.DataReady}">
</ComboBox>