mvvm

Multiple Views that have same ViewModel

故事扮演 提交于 2021-02-10 20:25:09
问题 In my Application business i have 3 step to define a person...in each step i get some info fro my person... For example i get firstname and lastname in step 1 and persontype in step 2 and get other info in step 3... I use from transition UI for show steps to my user and using from Fluidkit for any steps i have a usercontrol ...how can i bind my usercontrols to one ViewModel? 回答1: Your question isn't very clear, but yes, you can certainly use the same ViewModel instance for multiple different

Multiple Views that have same ViewModel

走远了吗. 提交于 2021-02-10 20:22:47
问题 In my Application business i have 3 step to define a person...in each step i get some info fro my person... For example i get firstname and lastname in step 1 and persontype in step 2 and get other info in step 3... I use from transition UI for show steps to my user and using from Fluidkit for any steps i have a usercontrol ...how can i bind my usercontrols to one ViewModel? 回答1: Your question isn't very clear, but yes, you can certainly use the same ViewModel instance for multiple different

How to properly cancel a Task on ViewModel-deactivation with ReactiveUI?

 ̄綄美尐妖づ 提交于 2021-02-10 12:44:59
问题 In my MVVM application, when a ViewModel gets activated, a Task gets started that establishes a network connection and could take some time to complete. This Task is cancalable: private async Task ConnectAsync(CancellationToken cancellationToken = default) { ... } I'm using IActivatableViewModel to start it on ViewModel-activation like that: // Constructor: public SomeViewModel(...) { this.WhenActivated(disposable => { Observable.StartAsync(ConnectAsync); }); } Now what is the recommended

vue基本知识点

家住魔仙堡 提交于 2021-02-10 04:30:01
Vue 尤雨溪 渐进式的JAVAscript框架 MVVM框架 M:model层 数据的增删改查 V:view层 视图 类似与HTML一样的模板 VM:viewModel model和view的一个映射层 优点: 数据驱动视图 回流和重绘 简单的来说页面的排版布局发生了改变就是回流 简单来说对一个元素进行样式操作不会导致页面布局发生改变重绘 回流一定会发生重绘 重绘不一定发生回流 vue常用的指令 v-text {{}} v-html v-bind : v-on @ .stop .prev .enter .keyCode值 $event v-model form表单 .number Object.defineProperty Proxy v-for v-show v-if 区别: 前者操作元素的display属性 初次渲染的开销较大 后者操作元素的创建和销毁 开销较大 使用场景: v-else-if v-else v-pre v-cloak v-once v-slot 插槽 自定义指令 全局注册 Vue.directive() 局部注册 VUE({ }) 过滤器 Vue.filter() 组件 Vue.component() watch 属性监听 基于Vue的依赖,当依赖的属性发生了改变的时候,那么就会自动触发相对应的方法进行数据的处理

Raise PropertyChanged event on a specific object

六眼飞鱼酱① 提交于 2021-02-08 12:00:54
问题 So i have a class (called DataClass) that handles some application data. The class implemented the INotifyPropertyChanged interface. Currently i have 2 static instances of this class (DataRx and DataTx) that i created in the ViewModelBase class and I want to raise the PropertyChanged events on each class separately. On the ViewModel the implementation is: DataRx.PropertyChanged += DataRx_PropertyChanged; DataTx.PropertyChanged += DataTx_PropertyChanged; The issue is that while I'm changing

ItemSource Binding on ComboBox inside a DataGrid

不问归期 提交于 2021-02-08 11:51:57
问题 The ComboBox inside the DataGrid is not getting populated with the List. I think there is an issue with ItemSource Path : View (xaml code for the DataGrid) : <DataGrid CanUserAddRows="True" ItemsSource="{Binding Path=GridCollection, Mode=TwoWay}" AutoGenerateColumns="False" IsReadOnly="False"> <DataGrid.Columns> <DataGridTemplateColumn Header="Column 1"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Path=DataContext.ComboBoxList}" BorderThickness="0"

ItemSource Binding on ComboBox inside a DataGrid

心不动则不痛 提交于 2021-02-08 11:51:08
问题 The ComboBox inside the DataGrid is not getting populated with the List. I think there is an issue with ItemSource Path : View (xaml code for the DataGrid) : <DataGrid CanUserAddRows="True" ItemsSource="{Binding Path=GridCollection, Mode=TwoWay}" AutoGenerateColumns="False" IsReadOnly="False"> <DataGrid.Columns> <DataGridTemplateColumn Header="Column 1"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Path=DataContext.ComboBoxList}" BorderThickness="0"

WPF: Hydrate Canvas with Draggable Controls at Runtime

做~自己de王妃 提交于 2021-02-08 11:02:11
问题 This is what I'm trying to accomplish: I want to have a canvas that supports dragging and dropping arbitrary data in the style of Microsoft Visio. I've found this link that does that: http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx However, I also want to hydrate the canvas at run-time. I found this post: https://stackoverflow.com/questions/889825/wpf-is-it-possible-to-bind-a-canvass-children-property-in-xaml One of the solutions suggests drawing each item on it's own Canvas,

WPF: Hydrate Canvas with Draggable Controls at Runtime

烂漫一生 提交于 2021-02-08 11:01:08
问题 This is what I'm trying to accomplish: I want to have a canvas that supports dragging and dropping arbitrary data in the style of Microsoft Visio. I've found this link that does that: http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx However, I also want to hydrate the canvas at run-time. I found this post: https://stackoverflow.com/questions/889825/wpf-is-it-possible-to-bind-a-canvass-children-property-in-xaml One of the solutions suggests drawing each item on it's own Canvas,

Change view in wpf single page application depending upon child view model

瘦欲@ 提交于 2021-02-08 10:30:54
问题 I write an application in wpf and using mvvm pattern. I try to implement a single page application using a ContentControl and DataTemplate. In my application I want to switch a view depending on the child view model like this: I have a mainwindow with a content control that its content is binding to a property in MainViewModel: public BaseViewModel CurrentViewModel { get; set; } in the consturctor I wrote: CurrentViewModel = new LoginViewModel(); in LoginViewModel I have a function that gets