Click here to Skip to main content
15,867,453 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: DropDown TreeView Pin
Kevin Marois2-Mar-23 11:30
professionalKevin Marois2-Mar-23 11:30 
GeneralRe: DropDown TreeView Pin
Gerry Schmitz3-Mar-23 5:25
mveGerry Schmitz3-Mar-23 5:25 
QuestionStyles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 1:50
Simos Sigma22-Feb-23 1:50 
Rant[REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Richard Deeming22-Feb-23 3:51
mveRichard Deeming22-Feb-23 3:51 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 22:16
Simos Sigma22-Feb-23 22:16 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma22-Feb-23 23:46
Simos Sigma22-Feb-23 23:46 
GeneralRe: [REPOST] Styles aren't apply on Window element in Design Mode when they are coming from a Resource Dictionary included into a .dll reference Pin
Simos Sigma23-Feb-23 0:55
Simos Sigma23-Feb-23 0:55 
QuestionWPF .Net Core 6 RelayCommand Problem Pin
Kevin Marois3-Feb-23 12:33
professionalKevin Marois3-Feb-23 12:33 
I'm trying to create a simple log in window. The Sign In button does not get enabled. The CanExecuteChange fires on startup, but never after that.

You can see that I'm using the Community Toolkit. I've also tried the RelayCommand in my own framework. Neither work. I have also tried
CommandManager.InvalidateRequerySuggested();
in the UserName and Password properties.

Here's the Sign In button
<Button Grid.Row="7"
        Grid.Column="0"
        Content="Sign In"
        Command="{Binding SignInCommand}"
        Margin="0,0,0,0"/>
Here's the View Model
using CommunityToolkit.Mvvm.Input;
using Marois.Framework.Core.Shared;
using System.Windows.Input;

namespace Jayhawk.UI.WPF.ViewModels
{
    public class LoginViewModel : _DialogViewModelBase
    {
        #region Private Fields
        private readonly IEventAggregator _eventAggregator;
        #endregion

        #region Properties
        private string? _UserName;
        public string? UserName
        {
            get { return _UserName; }
            set
            {
                SetProperty(nameof(UserName), ref _UserName, value);
            }
        }

        private string? _Password;
        public string? Password
        {
            get { return _Password; }
            set
            {
                SetProperty(nameof(Password), ref _Password, value);
            }
        }

        private bool _IsRememberMeChecked;
        public bool IsRememberMeChecked
        {
            get { return _IsRememberMeChecked; }
            set
            {
                SetProperty(nameof(IsRememberMeChecked), ref _IsRememberMeChecked, value);
            }
        }

        private bool _IsLoggingIn;
        public bool IsLoggingIn
        {
            get { return _IsLoggingIn; }
            set
            {
                SetProperty(nameof(IsLoggingIn), ref _IsLoggingIn, value);
            }
        }
        #endregion

        #region Commands
        private ICommand? _SignInCommand;
        public ICommand? SignInCommand
        {
            get
            {
                if (_SignInCommand == null)
                    _SignInCommand = new RelayCommand(SignInExecuted, SignInCanExecute);
                return _SignInCommand;
            }
        }
        #endregion

        #region CTOR
        public LoginViewModel()
        {
        }
        #endregion

        #region Private Methods
        private bool SignInCanExecute()
        {
            return !string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password);
        }

        private void SignInExecuted()
        {
            IsLoggingIn = true;

            // TODO: Do the log in
        }
        #endregion
    }
}
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: WPF .Net Core 6 RelayCommand Problem Pin
Richard Deeming5-Feb-23 23:18
mveRichard Deeming5-Feb-23 23:18 
Questionhow to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170031-Feb-23 14:56
Member 136170031-Feb-23 14:56 
AnswerRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Richard MacCutchan1-Feb-23 21:12
mveRichard MacCutchan1-Feb-23 21:12 
GeneralRe: how to set the icon for output result(.exe) in vs2022 ? Pin
Member 136170032-Feb-23 13:43
Member 136170032-Feb-23 13:43 
QuestionExpander Width Problem Pin
Kevin Marois13-Jan-23 13:01
professionalKevin Marois13-Jan-23 13:01 
AnswerRe: Expander Width Problem Pin
Gerry Schmitz14-Jan-23 5:43
mveGerry Schmitz14-Jan-23 5:43 
QuestionTabItem Render Pin
Kevin Marois9-Jan-23 18:59
professionalKevin Marois9-Jan-23 18:59 
AnswerRe: TabItem Render Pin
Pete O'Hanlon9-Jan-23 19:38
subeditorPete O'Hanlon9-Jan-23 19:38 
GeneralRe: TabItem Render Pin
Kevin Marois9-Jan-23 20:07
professionalKevin Marois9-Jan-23 20:07 
GeneralRe: TabItem Render Pin
Pete O'Hanlon9-Jan-23 20:38
subeditorPete O'Hanlon9-Jan-23 20:38 
GeneralRe: TabItem Render Pin
Gerry Schmitz10-Jan-23 6:45
mveGerry Schmitz10-Jan-23 6:45 
QuestionWPF Custom Control & User Control Pin
Kevin Marois30-Dec-22 18:49
professionalKevin Marois30-Dec-22 18:49 
AnswerRe: WPF Custom Control & User Control Pin
Graeme_Grant31-Dec-22 3:18
mvaGraeme_Grant31-Dec-22 3:18 
GeneralRe: WPF Custom Control & User Control Pin
Kevin Marois31-Dec-22 8:44
professionalKevin Marois31-Dec-22 8:44 
GeneralRe: WPF Custom Control & User Control Pin
Graeme_Grant31-Dec-22 10:53
mvaGraeme_Grant31-Dec-22 10:53 
AnswerRe: WPF Custom Control & User Control Pin
Sandeep Mewara31-Dec-22 8:55
mveSandeep Mewara31-Dec-22 8:55 
GeneralRe: WPF Custom Control & User Control Pin
Kevin Marois31-Dec-22 14:59
professionalKevin Marois31-Dec-22 14:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.