Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Working flipper
  • Loading branch information
Keboo committed Jan 4, 2024
commit b74cbce66cfaa3f224d50cb51624d9e54004688a
28 changes: 26 additions & 2 deletions MainDemo.Wpf/3DTest.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,46 @@
</Grid>
</materialDesign:Card>

<Button Width="192"
Margin="8"
Content="RESIZING..."
x:Name="ButtonContent"
Style="{StaticResource MaterialDesignFlatButton}">
<Button.RenderTransform>
<TranslateTransform X="-10000000" />
</Button.RenderTransform>
</Button>

<Rectangle Margin="50,0" />

<materialDesign:Plane3DNew x:Name="PART_Plane3D"
Width="{Binding ActualWidth, ElementName=FlipperContent}"
Height="{Binding ActualHeight, ElementName=FlipperContent}"
IsHitTestVisible="False"
RotationY="{Binding Value, ElementName=RotationYSlider}"
StartingContent="{Binding ElementName=FlipperContent}"
ZFactor="2.055" />
ZFactor="2.055">
<materialDesign:Plane3DNew>
<Style TargetType="materialDesign:Plane3DNew">
<Setter Property="StartingContent" Value="{Binding ElementName=FlipperContent}" />

<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=ToggleButton}" Value="True">
<Setter Property="StartingContent" Value="{Binding ElementName=ButtonContent}" />
</DataTrigger>
</Style.Triggers>
</Style>
</materialDesign:Plane3DNew>
</materialDesign:Plane3DNew>

</StackPanel>

<StackPanel Grid.Column="1" VerticalAlignment="Center">
<Slider x:Name="RotationYSlider"
Maximum="90"
Minimum="-90" />

<ToggleButton HorizontalAlignment="Center" x:Name="ToggleButton"
Style="{StaticResource MaterialDesignActionSecondaryToggleButton}"/>
</StackPanel>
</Grid>
</UserControl>
54 changes: 27 additions & 27 deletions MainDemo.Wpf/Cards.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@
</smtx:XamlDisplay>

<smtx:XamlDisplay Margin="4,4,0,0"
VerticalContentAlignment="Top"
UniqueKey="flipper_1">
VerticalContentAlignment="Top"
UniqueKey="flipper_1">
<materialDesign:FlipperNew VerticalAlignment="Top" Style="{StaticResource MaterialDesignCardFlipperNew}">
<materialDesign:FlipperNew.FrontContent>
<Button Width="192"
Margin="8"
Command="{x:Static materialDesign:FlipperNew.FlipCommand}"
Content="RESIZING..."
Style="{StaticResource MaterialDesignFlatButton}" />
Margin="8"
Command="{x:Static materialDesign:FlipperNew.FlipCommand}"
Content="RESIZING..."
Style="{StaticResource MaterialDesignFlatButton}" />
</materialDesign:FlipperNew.FrontContent>
<materialDesign:FlipperNew.BackContent>
<Grid Width="200" Height="256">
Expand All @@ -538,47 +538,47 @@
<materialDesign:ColorZone Padding="6" Mode="SecondaryMid">
<StackPanel Orientation="Horizontal">
<Button HorizontalAlignment="Left"
Command="{x:Static materialDesign:FlipperNew.FlipCommand}"
Style="{StaticResource MaterialDesignToolForegroundButton}">
Command="{x:Static materialDesign:FlipperNew.FlipCommand}"
Style="{StaticResource MaterialDesignToolForegroundButton}">
<materialDesign:PackIcon HorizontalAlignment="Right" Kind="ArrowLeft" />
</Button>
<TextBlock Margin="8,0,0,0"
VerticalAlignment="Center"
Text="EDIT USER" />
VerticalAlignment="Center"
Text="EDIT USER" />
</StackPanel>
</materialDesign:ColorZone>

<Grid Grid.Row="1"
Width="172"
Margin="0,6,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top">
Width="172"
Margin="0,6,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox Margin="0,12,0,0"
materialDesign:HintAssist.Hint="First name"
materialDesign:HintAssist.IsFloating="True"
Text="James" />
materialDesign:HintAssist.Hint="First name"
materialDesign:HintAssist.IsFloating="True"
Text="James" />
<TextBox Grid.Row="1"
Margin="0,12,0,0"
materialDesign:HintAssist.Hint="Last name"
materialDesign:HintAssist.IsFloating="True"
Text="Willock" />
Margin="0,12,0,0"
materialDesign:HintAssist.Hint="Last name"
materialDesign:HintAssist.IsFloating="True"
Text="Willock" />
<StackPanel Grid.Row="2"
Margin="0,12,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
Margin="0,12,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Email Contact" />
<ToggleButton Margin="8,0,0,0" />
</StackPanel>
<StackPanel Grid.Row="3"
Margin="0,12,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
Margin="0,12,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Telephone Contact" />
<ToggleButton Margin="8,0,0,0" />
</StackPanel>
Expand Down
10 changes: 5 additions & 5 deletions MaterialDesignThemes.Wpf/Plane3DNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ private void SetupVisualElements()
var m3DGroup = new Model3DGroup
{
Children =
{
new DirectionalLight(Colors.White, new Vector3D(0, 0, -1)),
new DirectionalLight(Colors.White, new Vector3D(0.1, -0.1, 1)),
backModel
}
{
new DirectionalLight(Colors.White, new Vector3D(0, 0, -1)),
new DirectionalLight(Colors.White, new Vector3D(0.1, -0.1, 1)),
backModel
}
};

// Non-interactive Visual3D consisting of the backside, and two lights.
Expand Down
Loading