mvvm

RxSwift enable/disable button based on textfield input

烈酒焚心 提交于 2021-02-11 12:29:42
问题 I have to implement below scenarios with RxSwift MVVM I have two textfields (OTP & Confirm OTP) and a Submit button, If user clicks on the OTP textfield when there is no value on the OTP textfield then submit button should be disabled, Now if user types something in otp textfield button should be enabled. Now if user taps on the second text field as it is blank now then the button should be disabled again & its get enabled only when there is a value. So basically I want to enable/disable the

why does x:Bind expect a static method to bind to?

混江龙づ霸主 提交于 2021-02-11 12:22:35
问题 I have a UWP MVVM application where I bind, amongst others, the following property to a DataGridComboBoxColumn : public List<ComboBoxValues> ListValues { get; set; } = new List<ComboBoxValues>(); XAML: xmlns:local="using:MyProject.ViewModels" <controls:DataGridComboBoxColumn Header="myHeader" Binding="{Binding theSelectedValue, Mode=TwoWay}" ItemsSource="{x:Bind local:PageVM.ListValues, Mode=OneWay}" DisplayMemberPath="theValueOptions"/> I use dependency injection, using Autofac to generate

How to bind one texblock value to other textblock one way and get value in MVVM

筅森魡賤 提交于 2021-02-11 07:04:10
问题 Let me explain my question by an Image I have MVVM structure in My project. I have two textblocks, Textblock 1 and textblock 2 . Now I want textblock2's Text same as Textblock1's Text, whenever Textblock1's Text changed. but I should be able to set Textblock2's Text different from Textblock1's . So I am setting Oneway binding of Textblock1's Text Property. How Can I get the Text property of Textblock2's In MVVM. If I create a property for Textblock2's Text property, I wont be able to bind

How to bind one texblock value to other textblock one way and get value in MVVM

扶醉桌前 提交于 2021-02-11 07:02:40
问题 Let me explain my question by an Image I have MVVM structure in My project. I have two textblocks, Textblock 1 and textblock 2 . Now I want textblock2's Text same as Textblock1's Text, whenever Textblock1's Text changed. but I should be able to set Textblock2's Text different from Textblock1's . So I am setting Oneway binding of Textblock1's Text Property. How Can I get the Text property of Textblock2's In MVVM. If I create a property for Textblock2's Text property, I wont be able to bind

Highlight ListView Item From Code - WPF Data Binding

你离开我真会死。 提交于 2021-02-11 07:01:52
问题 Previous Sources I Visited (and did not find an answer): Highlight Row In WPF Selected Item Color Highlighting Items In WPF ListView Triggers For Styling Styles For Styling And more closely-related yet too complicated/not exactly what I need sources. General Information: As tagged, this code is in c# , using WPF , with target framework .NET Framework 4.5 . Note: This is my first try at implementing MVVM , so comments about best-practices i'm missing will be appreciated (although this is not

Kotlin cannot create an instance of ViewModel

假如想象 提交于 2021-02-11 04:32:57
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

Kotlin cannot create an instance of ViewModel

穿精又带淫゛_ 提交于 2021-02-11 04:28:59
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

Kotlin cannot create an instance of ViewModel

二次信任 提交于 2021-02-11 04:28:20
问题 I've been getting the following error against my ViewModel: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cryptpass_kt/com.example.cryptpass_kt.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.example.cryptpass_kt.EntryViewModel at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928) at android.app.ActivityThread.-wrap11(Unknown

WPF TabControl no selected Item on start

情到浓时终转凉″ 提交于 2021-02-11 02:01:07
问题 I am using a WPF tabcontrol to display items which are bound from a viewmodel. By default on start the first item of the list is selected but I want no item to be selected on start. I can set the SelectedItem in the OnSelectionChanged event to null then no item is selected on start but then it is no longer possible to manually select a item. public partial class ProjectScopeMain : Window { private bool firstStart = true; public ProjectScopeMain() { this.Initialized += this.ProjectScopeMain

WPF TabControl no selected Item on start

╄→尐↘猪︶ㄣ 提交于 2021-02-11 01:58:00
问题 I am using a WPF tabcontrol to display items which are bound from a viewmodel. By default on start the first item of the list is selected but I want no item to be selected on start. I can set the SelectedItem in the OnSelectionChanged event to null then no item is selected on start but then it is no longer possible to manually select a item. public partial class ProjectScopeMain : Window { private bool firstStart = true; public ProjectScopeMain() { this.Initialized += this.ProjectScopeMain