Skip to content
  • WPF .Net Core 6 RelayCommand Problem

    WPF csharp wpf asp-net dotnet design
    2
    0 Votes
    2 Posts
    7 Views
    Richard DeemingR
    Looking at the source code for CommunityToolkit.Mvvm.Input.RelayCommand[^], it doesn't use the CommandManager at all. You need to explicitly call the NotifyCanExecuteChanged method[^] instead. NB: That SetProperty method looks odd - any relatively recent framework would use [CallerMemberName] so that you don't need to pass the name of the property: protected bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) { if (Equals(storage, value)) return false; storage = value; OnPropertyChanged(propertyName); return true; } public string? UserName { get { return _UserName; } set { SetProperty(ref _UserName, value); } } "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
  • 0 Votes
    3 Posts
    0 Views
    Graeme_GrantG
    Ah, sorry, I missed that 😬 Graeme "I fear not the man who has practiced ten thousand kicks one time, but I fear the man that has practiced one kick ten thousand times!" - Bruce Lee
  • 0 Votes
    14 Posts
    0 Views
    S
    Reddit - Dive into anything[^]
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • What is your language feature wish list?

    The Lounge c++ question csharp wpf ai-coding
    42
    0 Votes
    42 Posts
    2 Views
    C
    C: - A standard (and simple) way to declare a parameter (or local variable) as not-nullable. Clang supports such an extension, as does gcc (but in a less clean way). It would be better to have a portable tag to do it defined in the language standards. Honestly, this should have been done in back in C99, and would have probably stopped many bugs over the last decade or two. - Variable value bound declarations. So if a parameter is declared unsigned int, but really only has a meaningful range of 0-100, it could flag it during compile time that it is an error. Probably more useful to set reasonable bounds on items which could cause integer overflows (or static buffer overflows when still used due to legacy code).. For example: typedef struct { int id; char name[20]; } myrecord_t; myrecord_t * alloc_list(__bound__(0, 10000000) unsigned int size) { /* size > 178956970 on 32-bit ===> overflow */ return malloc(size * sizeof(myrecord_t)); } void safecaller(__bound__(1, 100000) unsigned int size) { /* Okay - [1-1000000] with-in [0, 10000000] bounds */ myrecord_t * list = alloc_list(size); /* ... */ } void badcaller(unsigned int size) { /* Compile ERROR - default (32-bit) unsigned int not with-in [0, 10000000] bounds */ myrecord_t * list = alloc_list(size); /* ... */ }
  • 0 Votes
    2 Posts
    0 Views
    N
    Kent Sharkey wrote: One UI to rule them all, one UI to find them, one UI to bring them all, and in the darkness command-bind them I have a dejà vóu :rolleyes: :-D M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • 0 Votes
    5 Posts
    0 Views
    B
    thanks Gsry, Been a long time since i read sci-fi, but J.G. Ballard comes to mind. literary: Percy Shelley ... Ozymandias Borges: ,,, The Library of Babel, Asterion philosophy: the recurrent myth of a "lost paradise:" Rene Dubos"The Mirage of Heakth"cheers, bill history: Lisa Jardine, "Worldly Goods" the profound stimulus to the Renaissance that unique goods from China (silk, porcelain) had, as well as the assimilation of ancient Greek science, geometry, astronomy from the Arabs who had preserved it and developed it much further, «The mind is not a vessel to be filled but a fire to be kindled» Plutarch
  • 0 Votes
    1 Posts
    3 Views
    No one has replied
  • 0 Votes
    2 Posts
    0 Views
    N
    It actually looks interesting. :thumbsup: M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • 0 Votes
    2 Posts
    0 Views
    N
    I think the veredict might be more interesting to be framed and sold... specially if the guy wins. M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.
  • 0 Votes
    22 Posts
    58 Views
    A
    Hello, Let me try to explain my words. When I say "common controls" I mean edit/combo/listbox/list/tree controls with event driven data flow. When I say common controls I mean Windows 3.X and its descendants. Windows Forms, like Delphi previously, use this model with a few extensions. When I say drugs addicted design I mean a new approach when framework developers are too lazy or to dump to implement all the common controls and pass this work to the application developers. My favorite example - Android GUI. WPF and its next approach called UWP are another examples of this kind of technology.
  • Expander Width Problem

    WPF wpf css wcf help question
    2
    0 Votes
    2 Posts
    5 Views
    L
    You should know what the maximum header width will be; set the .Width accordingly. (The framework doesn't know beforehand). "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • WPF Custom Control & User Control

    WPF csharp wpf design help tutorial
    10
    0 Votes
    10 Posts
    15 Views
    K
    Sorry for the confusion. I just asumed that MVVM is the way most folks do things. So I found out a way to load my control: public override void OnApplyTemplate() { base.OnApplyTemplate(); Load(); } Not sure if this is the best way, but it works. Thanks If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
  • 0 Votes
    8 Posts
    0 Views
    R
    Southmountain wrote: Can I post my question here? We won't know until you try. :-D /ravi My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com
  • Path Image

    WPF question csharp wpf com help
    4
    0 Votes
    4 Posts
    7 Views
    L
    No, I'm not seeing that. You're either inheriting something; or it's a version thing. I tested it with a new WPF .NET 6.0 project. "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
  • Image Path Data

    WPF question wpf help
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    3 Posts
    10 Views
    J
    Flyway... I'd use Flyway. Whether using repeatable migrations or versioned + undo you could accomplish what I'll call "feature-branched DB state management" which is what it sounds like you want.
  • Growing pains

    The Lounge c++ wpf question
    8
    0 Votes
    8 Posts
    0 Views
    D
    What were we talking about?
  • 0 Votes
    3 Posts
    6 Views
    G
    Thanks, Gerry. My WPF application code was fairly consistent in its application of Binding with commands and converters, and I'd like to continue that level of consistency as I refactor it to WinUI 3. I'd like to take advantage of the x:Bind performance improvements, but also remain consistent in the way it's used. In other words, I'd prefer to continue to wholly use Binding (to DataContext) with traditional commands and converters, wholly use x:Bind (to code-behind objects) with traditional commands and converter classes, or wholly use x:Bind with functions (no commands or converters). This may not make sense or be possible, I just haven't gotten far enough into it to tell. So far I haven't found any showstoppers, and that's why I'm curious. But I'm also only about 10% into it.