InspectionsByTasksViewModel vm = (DataContext as InspectionsByTasksViewModel);
Select allOpen in new window
By the looks of it, this is not initialization,
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent
If you would post the entire code snippet it would have been easier to explain. By the looks of it, this is not initialization, this is casting.
It will try to cast the DataContext as a type of InspectionsByTasksViewMode
Biggest advantage or disadvantage of as keyword is, that the as operator is like a cast operation. But, if the conversion isn't possible, as returns null instead of raising an exception.