Quantcast
Channel: MVVM Light Toolkit
Viewing all 1826 articles
Browse latest View live

Edited Unassigned: RaisePropertyChanging gone in V.5 ?! [7662]

$
0
0
Seems like RaisePropertyChanging was removed from the ViewModelBase? I've upgarded from 4.2, and besides the buttons isssue, i'm also having the following:

public class MyBase_ViewModel : ViewModelBase
{
// THIS ONE IS OK
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanged([CallerMemberName]string property = "")
{
base.RaisePropertyChanged(property);
}

// THIS ONE IS COMPLAINING ABOUT NO METHOD TO OVERRIDE
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanging([CallerMemberName]string property = "")
{
base.RaisePropertyChanging(property);
}
}

shall i just remove it, or are there any other implications involved ?


Commented Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.
Comments: Still present in 5.0.2 in WP8.0 SL projects. I have a command RelayCommand<T> with defined Execute and CanExecute. CanExecute function is never calling. If I removing CanExecure definition, then the command is executing.

Commented Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.
Comments: Hi, It cannot be the same issue, as that issue was only available in WPF projects. There is no CommandManager in SL. Can you send me a repro? In SL you need to raise the CanExecuteChanged event manually. Cheers Laurent

Edited Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.

Commented Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.
Comments: Hi I've discovered that this is not the same issue (sorry for blaming). Here is workaround: - create a generic command that receives some class - bind this command to XAML without value for CommandParameter In previous version CommandParameter without value leads to null value in code. Now command just not executing

Commented Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.
Comments: Hi, Yes this is correct. "null" is not acceptable for the CanExecute method, and so it will simply return false. That makes sense if you think of it. Cheers Laurent

Commented Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.
Comments: But this very inconvenience. This is breaking a lot of code that had written before. I can understand such behavior for value types but not for reference types. Why not defined CommandParameter is not NULL?

Created Unassigned: Relay Command CanExecute() not working in WP for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.

Edited Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.

Commented Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.
Comments: With current behavior we cannot use simple pattern to work with objects: null value - create new object, not null value - edit existing object. With current RelayCommand<T> we have to create different commands for object creating and object editing.

Commented Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.
Comments: My proposal: replace condition with next code: ``` if (! #if NETFX_CORE typeof(T).GetTypeInfo().IsValueType) #else typeof(T).IsValueType) #endif || parameter != null) ```

Commented Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.
Comments: I get what you say. The null check was introduced to solve another issue where the command code was attempting to cast the null parameter and was failing. Let me think over your proposal and make sure that it doesn't break anything else. Thanks for following up and opening a new issue rather than writing on the other one, appreciated. Laurent

Closed Issue: Relay Command CanExecute() not working in WPF [7659]

$
0
0
After updating to version 5 the CanExecute() stopped working correctly. It validates the first time, like when the window is open, but it won't make any more validations after that.

Commented Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.
Comments: I experience the same issue in a normal .NET 4.5 application (no WinRT, but VB.NET). This is critical to me because I cannot update to the latest version of MVVM Light V5 to get other bug fixes...

Commented Unassigned: Relay Command CanExecute() not working in WinRT for refence types [7663]

$
0
0
- create a generic command that receives some class
- bind this command to XAML without value for CommandParameter
In previous version CommandParameter without value leads to null value in code. Now command just not executing.
Is think reference types as command parameter should accept NULL.



In PCL version RelayCommandGeneric.cs, public bool CanExecute(object parameter):

```
if (parameter == null
#if NETFX_CORE
&& typeof(T).GetTypeInfo().IsValueType)
#else
&& typeof(T).IsValueType)
#endif

```
This is covering value type check only, no reference type check.
Comments: You may copy-paste code from Execute method. It contains null-check and value type check

Created Unassigned: Bug in RelayCommand? [7664]

$
0
0
We're using a RelayCommand<T> with both an execute and canExecute delegate in our view model.
In XAML, we bind Button.Command to the command and Button.CommandParameter to the selected item of ListBox.

In version 4, whenever the user changes the SelectedItem of the ListBox, the RelayCommand<T>.CanExecute is re-evaluated with the new command parameter value.

After upgrading to version 5, the RelayCommand<T>.CanExecute is never evaluated. Not when the Window is loaded (because the command parameter is null at that moment), but also not when an item is selected in the list box.

Please fix!

Thanks,
Joost

Commented Unassigned: Bug in RelayCommand? [7664]

$
0
0
We're using a RelayCommand<T> with both an execute and canExecute delegate in our view model.
In XAML, we bind Button.Command to the command and Button.CommandParameter to the selected item of ListBox.

In version 4, whenever the user changes the SelectedItem of the ListBox, the RelayCommand<T>.CanExecute is re-evaluated with the new command parameter value.

After upgrading to version 5, the RelayCommand<T>.CanExecute is never evaluated. Not when the Window is loaded (because the command parameter is null at that moment), but also not when an item is selected in the list box.

Please fix!

Thanks,
Joost
Comments: Hi, Can you confirm: - that you are using WPF (I think so since you mention a Window) - that you are indeed on the latest version of MVVM Light (V5.0.2). There was a bug with RelayCommand.CanExecute which was fixed in 5.0.2. Thanks! Laurent

Edited Issue: Bug in RelayCommand? [7664]

$
0
0
We're using a RelayCommand<T> with both an execute and canExecute delegate in our view model.
In XAML, we bind Button.Command to the command and Button.CommandParameter to the selected item of ListBox.

In version 4, whenever the user changes the SelectedItem of the ListBox, the RelayCommand<T>.CanExecute is re-evaluated with the new command parameter value.

After upgrading to version 5, the RelayCommand<T>.CanExecute is never evaluated. Not when the Window is loaded (because the command parameter is null at that moment), but also not when an item is selected in the list box.

Please fix!

Thanks,
Joost

Commented Unassigned: RaisePropertyChanging gone in V.5 ?! [7662]

$
0
0
Seems like RaisePropertyChanging was removed from the ViewModelBase? I've upgarded from 4.2, and besides the buttons isssue, i'm also having the following:

public class MyBase_ViewModel : ViewModelBase
{
// THIS ONE IS OK
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanged([CallerMemberName]string property = "")
{
base.RaisePropertyChanged(property);
}

// THIS ONE IS COMPLAINING ABOUT NO METHOD TO OVERRIDE
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanging([CallerMemberName]string property = "")
{
base.RaisePropertyChanging(property);
}
}

shall i just remove it, or are there any other implications involved ?

Comments: Hi, I had to remove PropertyChanging support because the PCL framework doesn't support this event. I am trying to see if I have a good alternative for future versions. In the code above, you can remove the override without side effects. If you need an alternative to handling the PropertyChanging event, let me know and I'll send you sample code. Cheers Laurent

Edited Issue: RaisePropertyChanging gone in V.5 ?! [7662]

$
0
0
Seems like RaisePropertyChanging was removed from the ViewModelBase? I've upgarded from 4.2, and besides the buttons isssue, i'm also having the following:

public class MyBase_ViewModel : ViewModelBase
{
// THIS ONE IS OK
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanged([CallerMemberName]string property = "")
{
base.RaisePropertyChanged(property);
}

// THIS ONE IS COMPLAINING ABOUT NO METHOD TO OVERRIDE
[NotifyPropertyChangedInvocator]
protected override void RaisePropertyChanging([CallerMemberName]string property = "")
{
base.RaisePropertyChanging(property);
}
}

shall i just remove it, or are there any other implications involved ?

Viewing all 1826 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>