xaml

Binding to properties in both the ViewModel and CodeBehind

核能气质少年 提交于 2021-02-05 07:51:30
问题 I have what I'm sure is a ridiculously ignorant question, but I'm asking it anyways because I've searched and searched and either don't understand the solutions I'm seeing or not finding exactly the answer I seek. I have an MVVM application. My XAML is setup with the DataContext set to the VM where the data items on the screen are populated from the VM's properties. My CodeBehind doesn't fiddle with the data, only things relating to the screen. What I want to do now is bind certain UI

Binding to properties in both the ViewModel and CodeBehind

五迷三道 提交于 2021-02-05 07:51:08
问题 I have what I'm sure is a ridiculously ignorant question, but I'm asking it anyways because I've searched and searched and either don't understand the solutions I'm seeing or not finding exactly the answer I seek. I have an MVVM application. My XAML is setup with the DataContext set to the VM where the data items on the screen are populated from the VM's properties. My CodeBehind doesn't fiddle with the data, only things relating to the screen. What I want to do now is bind certain UI

WPF animation on data change

守給你的承諾、 提交于 2021-02-05 07:11:40
问题 I'm working on a WPF grid listing some Objects. In case the data of the object changes I want to start an animation. Below an excerpt of the XAML code is listed <ListView Name="ListViewEmployeeDetails" Grid.Row="1" Margin="4,109,12,23" ItemsSource="{Binding Products}" > <ListView.View> <GridView x:Name="grdTest"> <GridViewColumn Header="ID" Width="100"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock x:Name="idField" Text="{Binding ID}" TextDecorations="Underline" Foreground="Blue"/>

WPF animation on data change

别说谁变了你拦得住时间么 提交于 2021-02-05 07:10:57
问题 I'm working on a WPF grid listing some Objects. In case the data of the object changes I want to start an animation. Below an excerpt of the XAML code is listed <ListView Name="ListViewEmployeeDetails" Grid.Row="1" Margin="4,109,12,23" ItemsSource="{Binding Products}" > <ListView.View> <GridView x:Name="grdTest"> <GridViewColumn Header="ID" Width="100"> <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock x:Name="idField" Text="{Binding ID}" TextDecorations="Underline" Foreground="Blue"/>

Wait for animation, render to complete - XAML and C#

穿精又带淫゛_ 提交于 2021-02-05 04:54:29
问题 I have a situation where I am animating part of my XAML application, and I need to wait for the animation AND rendering to complete before I can move on in my code. So far the tail end of my function looks like: ProcExpandCollapse.Begin(); while (ProcExpandCollapse.GetCurrentState() != ClockState.Stopped) { } } Which, in theory, will wait until the animation is finished. But it will not wait until the rendering is finished - the thread drawing the application might still not have re-drawn the

Wait for animation, render to complete - XAML and C#

三世轮回 提交于 2021-02-05 04:46:10
问题 I have a situation where I am animating part of my XAML application, and I need to wait for the animation AND rendering to complete before I can move on in my code. So far the tail end of my function looks like: ProcExpandCollapse.Begin(); while (ProcExpandCollapse.GetCurrentState() != ClockState.Stopped) { } } Which, in theory, will wait until the animation is finished. But it will not wait until the rendering is finished - the thread drawing the application might still not have re-drawn the

WPF Binding Collection with Index

百般思念 提交于 2021-02-04 22:12:13
问题 I'm trying to use a collection that is a property of another collection to bind to a listbox. The following works fine <ListBox ItemsSource="{Binding Path=Locations[0].Buildings}"> the problem is that I need a dynamic index and <ListBox ItemsSource="{Binding Path=Locations[index].Buildings}"> where index is an integer in my viewmodel, does not work. Does anyone know how I can associate the index in my xaml with the property in my viewmodel? 回答1: where index is an integer in my viewmodel, does

How to add a grid view under Master-Detail detail page in Xamarin Forms?

邮差的信 提交于 2021-02-04 21:42:07
问题 I'm trying to add a grid view at the bottom of the screen containing 'Current Playing' information about a media being played in a media player. The problem is that I want this view to be there no matter what is the page visible. The main layout is a Master-Detail page for the navigation menu panel, where the detail page should contain everything. The detail page can be a content page, a navigation page (mostly) or a modal content page. However, if I might only choose one, I would choose it

How to add a grid view under Master-Detail detail page in Xamarin Forms?

≯℡__Kan透↙ 提交于 2021-02-04 21:42:01
问题 I'm trying to add a grid view at the bottom of the screen containing 'Current Playing' information about a media being played in a media player. The problem is that I want this view to be there no matter what is the page visible. The main layout is a Master-Detail page for the navigation menu panel, where the detail page should contain everything. The detail page can be a content page, a navigation page (mostly) or a modal content page. However, if I might only choose one, I would choose it

XAML binding against Auto-Implemented properties?

我只是一个虾纸丫 提交于 2021-02-04 21:05:55
问题 Is it possible to using XAML data binding to a model with Auto-Implemented properties? class ClassA { // pseudo code. int Width { get; set{ NotifyPropertyChange("Width");} } } //XAML <textBox width="{Binding Path=Width,Mode=OneWay}"/> 回答1: Auto-properties don't have a half auto mode. It needs to either be an auto-property with nothing extra: int Width { get; set; } or a fully expanded property with a backing store that can have additional code added to it, like change notification: int _width