private async void OnDriversGroupUpdated(object parameter) { Console.WriteLine($"Group updated for Driver : {parameter}"); UpdateDriversGroup updateDriverGroup = parameter as UpdateDriversGroup; if (updateDriverGroup == null || updateDriverGroup.Group == null || updateDriverGroup.Driver.GroupID == updateDriverGroup.Group.GroupID) { return; } Driver driver = new Driver() { LastName = updateDriverGroup.Driver.LastName, FirstName = updateDriverGroup.Driver.FirstName, UserName = updateDriverGroup.Driver.UserName, DriverID = updateDriverGroup.Driver.DriverID, Pin = updateDriverGroup.Driver.Pin, IsActive = updateDriverGroup.Driver.IsActive, GroupID = updateDriverGroup.Group.GroupID, ProductID = updateDriverGroup.Driver.ProductID, }; await UpdateDriverAsync(driver); OnGroupSelected(null); }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { if (values == null) { return(null); } UpdateDriversGroup updateDriversGroup = new UpdateDriversGroup(); updateDriversGroup.Driver = values[0] as Driver; updateDriversGroup.Group = values[1] as Group; return((object)updateDriversGroup); }