Click here to Skip to main content
15,896,063 members
Articles / Web Development / HTML

WPF x FileExplorer x MVVM

Rate me:
Please Sign up or sign in to vote.
4.99/5 (52 votes)
24 Nov 2012LGPL323 min read 291K   9.4K   228  
This article describe how to construct FileExplorer controls included DirectoryTree and FileList, using Model-View-ViewModel (MVVM) pattern.
<UserControl x:Class="CircularAnimations.Examples.BlueDot"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local='clr-namespace:CircularAnimations.Examples'
    xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"

    Height="80" Width="80">
	<UserControl.Resources>
	<!--BeginTime="{Binding ElementName=ellipse, Converter={StaticResource AngleConverter},
		Path=Width}"-->
		<Storyboard x:Key="GrowStoryBoard">
      
      <DoubleAnimationUsingKeyFrames   Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" RepeatBehavior="Forever">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02.6000000" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:03" Value="0" KeySpline="0.767,0,0.654,0.889"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames  Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" RepeatBehavior="Forever">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02.6000000" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:03" Value="0" KeySpline="0.767,0,0.654,0.889"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource GrowStoryBoard}"/>
		</EventTrigger>
		
	</UserControl.Triggers>
    <Grid>
    	<Ellipse Stroke="{x:Null}" x:Name="ellipse" RenderTransformOrigin="0.5,0.5">
    		<Ellipse.RenderTransform>
    			<TransformGroup>
    				<ScaleTransform ScaleX="0" ScaleY="0"/>
    				<SkewTransform AngleX="0" AngleY="0"/>
    				<RotateTransform Angle="0"/>
    				<TranslateTransform X="0" Y="0"/>
    			</TransformGroup>
    		</Ellipse.RenderTransform>
    		<Ellipse.Fill>
    			<RadialGradientBrush>
    				<GradientStop Color="#CA2C8DDE" Offset="0.634"/>
    				<GradientStop Color="#39FFFFFF" Offset="1"/>
    				<GradientStop Color="#CA2C64DE" Offset="0.33"/>
    				<GradientStop Color="#B56A8FDE" Offset="0.062"/>
    			</RadialGradientBrush>
    		</Ellipse.Fill>
    	</Ellipse>
            
    </Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Founder
Hong Kong Hong Kong

Comments and Discussions