Search results for query: *

  • Users: Daz66
  • Order by date
  1. D

    Dynamic UI Update

    This works, probably more of a workaround, but the collection won't update without a nudge. private ObservableCollection<ExpensesBaseClass>? _getAllExpenses; public ExpensesViewModel(IRepository<ExpensesBaseClass> expensesRepository) { _repository = expensesRepository...
  2. D

    Dynamic UI Update

    Hi all, I have a UserControl which is primarily a DataGrid which is populated by ObservableCollection. Dispatcher.CurrentDispatcher.Invoke(() => { GetAllExpenses = new ObservableCollection<ExpensesBaseClass>(_repository.GetAll()); }); private ObservableCollection<ExpensesBaseClass>...
  3. D

    Best practice

    Thanks @Skydiver, I quite enjoy the sql aspect to be honest, it's something else to learn too. I'v seen references to 'no SQL' but not researched it all...might have a look....presumably LINQ involved? The main premise was me wondering about the performance trade off between doing a bit more...
  4. D

    Best practice

    Hi all, I'm trying to create a Quotation section in my WPF app and it's going to involve cascading ComboBoxes. I use a local instance of MySql and ADO.NET with parameterised Stored Procedures to retrieve data. I have created multiple category tables with FK relationships to a parent category...
  5. D

    Binding failures

    LoadInvoices() is my DataAccess method, I use the Model for DataAccess/Save. Tried this approach but no joy. public class InvoicingViewModel : ObservableObject { private readonly IInvoicingModel _invoicingModel; public InvoicingViewModel(IInvoicingModel invoicingModel) {...
  6. D

    Binding failures

    It's set in my ViewModel....or maybe this should be different now? A DataTemplate for the grid maybe? <Window.DataContext> <viewModel:InvoicingViewModel /> </Window.DataContext> I've tried the in my ViewModel too, targeting the interface. public InvoicingViewModel() {...
  7. D

    Binding failures

    Update: I have extracted interface from my Model and using it in App.xaml like so. public App() { AppHost = Host.CreateDefaultBuilder() .ConfigureServices((hostContext, services) => { services.AddSingleton<MainWindow>()...
  8. D

    Binding failures

    Thank you @Skydiver, I'm deep in the Dependancy Injection rabbit hole at the moment based on your suggestion. Packages installed, and initiated...I think. public partial class App : Application { public static IHost? AppHost { get; private set; } public App() { AppHost =...
  9. D

    Binding failures

    No there isn't, it's the general premise of my post. I have been under the assumption I can access the property via my ViewModel using the method in my first post. If that's not the case; and probably not the first time the question has been asked, why have a Model? I'm obviously barking up...
  10. D

    Binding failures

    I only have the InvoicingViewModel for both windows, the parent view is simply a DataGrid that is populated with invoices. On row selection the data is sent to the child window to create an invoice. There are a few simple controls in the child, the DataContext of the child is set in the xaml...
  11. D

    Binding failures

    I'm a novice trying to conform to MVVM pattern, and understand that the main purpose of the ViewModel is to act as an intermediary between the Model and the View. My issue is, I get binding errors when I target properties that I have exposed to my ViewModel. I have a DataAccess method in my...
  12. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    Out of respect for the quality of assistance I've received, a quick update. I managed to achieve a resolution to my original question of sending DataGridRow data to TextBoxes in another window by accessing my grid in the viewModel and using a command to access my original method; it works...
  13. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    No problem, any help is appreciated whenever it comes :) I started afresh, taking on board your advice and also further research. I am at a similar point as per my original post; which is getting selected DataGrid row into TextBoxes in a child window. My approach is different now and is as...
  14. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    Ok, so I have wound things back. I've tidied up my CustomersModel using the correct naming conventions. I have added x 2 helper classes to deal with InotifyPropertyChanged and ICommand and now understand a little better regarding inheritance. What is foxing me now is DataTemplate. If I create...
  15. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    @Scottintexas, thank you so much for taking the time to reply, I've been quietly pulling my hair out in the background trying to figure this out :) I figured I was missing wiring between my Model and view model as most of the resources I read shows the properties in the ViewModel which made me...
  16. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    Thanks for the reply, I've added the 'Selected' property to my Model, is that what you meant? private object Selected; public object selected { get { return this.Selected; } set {...
  17. D

    Resolved WPF DataGridRow values to TextBoxes-MVVM

    Hi, I recently made the switch from WInforms to WPF. I'm trying to learn the mvvm pattern and am having a few issues, I'm a novice, so if any of you guys would have the time to take a look and give me a nudge in the right direction I would be extremely grateful. I have a DataGrid which populates...
  18. D

    Resolved Combobox Filter

    I have a lot to learn, but It's great fun. Thanks for sticking with me, your efforts have been greatly appreciated.
  19. D

    Resolved Combobox Filter

    We're in business. Was my main problem here the fact that form_Load is a private void?
Back
Top Bottom