❔ [AvaloniaUI] Visibility of item in ListView based on condition
An Avalonia UI application is used to manage an evidence of items. It allows the user to add items. or remove them.
The View displays a list of items in a
ListView
. The Item
model represents an item in the evidence. The ViewModel for the View handles retrieving the list of Item
instances. The View binds the observable list of Item
instances to the ListView
.
The goal is to show the Remove button as part of a ListViewItem
, but only when that given item in the ListView
is selected.
My idea is to only handle the collection of Item
instances and the currently selected Item
in the ViewModel, while the View would do the rest.
I wanted to accomplish it via a Converter, that would receive the templated Item
and the currently selected Item
.
However, after fighting with it for some time, I was unable to make it work.
Is my thinking correct - should the View be responsible for handling the Remove button visibility? Should it be done in the ViewModel?D
Denis•398d ago
I confess, that the current converter implementation and use is incorrect; however, I wish to hear some of your advice, before I continue mashing my head against the wall to find the correct solution.
The main question is whether my approach is even correct
A
Accord•397d ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
51KMembers
View on DiscordWant results from more Discord servers?
More Posts✅ How to structure this login/signup page layoutSo I have this mockup of the layout I want for a login/signup page in my Blazor WASM app. Pretty sta❔ I am need of help before I give up and run my code on a server instead of a serverless solution.I have create an azure function locally and i've used the selenuim webdriver package for taking scre✅ .Net Core 6 Asymmetric Encryption with custom public and private keysHello all! How can i use the `Asymmetric Encryption` in .Net 6 but choosing/importing private and pu❔ No Design in C#Instances of this bug (1)
1. View Call Stack
at System.Runtime.InteropServices.Marshal.ThrowExce❔ having issues on a reloading script on unity to reload weaponsthe code is used in a youtube video and i have pretty much copied to to get it to work but it doesnt❔ help with an exerciseI've encountered a weird problem that idk how to fix. Say we've got a string "31131123521" how do i ❔ Accessing HTTP Context at DbCommandInterceptor [.NET 7]Hi! I'm having some issues trying to access the HTTP Context at my DbCommand Interceptor class.
What❔ XMLAttributeCollection -> Dictionary with LINQ?It's a confusing class. It only allows turning it into a Queryable, but I have no experience with th❔ MS SQL Reporting Server URL Being RedirectedWe have an application from a vendor that was written in C# and we recently upgraded the MS SQL data❔ dataset memory leakI found memory leak and I don't understand how to fix it
Test case:
```cpp
public class MemoryLeaksT❔ WebAPI .NET 7.0 - Encrypt connectionstring in appsettings.jsonguys, I'm writing some WebAPI using .NET 7.0, and I'd like to secure the connectionstring with encry❔ how to read strings correctly with System.Data.SQLitei m trying read turkish characters from database but i can't see correctly❔ Blazor server app, base url / base page to set environmentHi 🙂
I have a Blazor Server app, where I would like to use some dynamic baseurl.
Say instead of my❔ C# Console Application -its only writing the same random string, how can i make it do different ones?