Powertoys, WPF and MVVM
#1
Hi

I consider Powertoys as drawing engine embedded in 3d modeling software about to create. 
I wonder how MVVM friendly PowerToys are? 

Ploting sphere is as easy as having

Code:
<visuals:SphereVisual3D CenterPosition="30 10 0" Radius="10" Material="s:64;Silver"/>
 
then let imagine I have collection of spheres dynamically added by users, so my ViewModel owns property encapsulating list of sphere's descriptors (ie size and location):
Code:
public ObservableCollection<SphereDescriptor> Spheres => _spheres;

where SphereDescriptor class is shaped like below:

Code:
class SphereDescriptor
{
  public LocationXYZ Position { get; } // don't know exact Sphere.CenterPostion's type
  public int Radius { get; }
}
 
and finally i'd like to have view defined like that:
Code:
<List ItemsSource={Binding Spheres}>
   <ItemTemplate>
           <visuals:SphereVisual3D CenterPosition="{Binding Position}" Radius="{Binding Radius}" Material="s:64;Silver"/>
   </ItemTemplate>
</List>
 Please notice Binding definition instead explicitly given values. 

So how MVVM friendly PowerToys are?
  


Messages In This Thread
Powertoys, WPF and MVVM - by Pioter - 07-11-2019, 12:51 PM
RE: Powertoys, WPF and MVVM - by abenedik - 07-12-2019, 12:04 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)