Skip to content

Commit

Permalink
feat(dragdrop): Add basic sample
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Oct 16, 2020
1 parent b3f7cb3 commit 6bb7b16
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\DragAndDrop\DragDrop_Basics.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\FocusManager\FocusManagerTest.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -3806,6 +3810,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\DeferLoadStrategy\SimpleDeferLoadStrategy.xaml.cs">
<DependentUpon>SimpleDeferLoadStrategy.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\DragAndDrop\DragDrop_Basics.xaml.cs">
<DependentUpon>DragDrop_Basics.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml\FocusManager\FocusManagerTest.xaml.cs">
<DependentUpon>FocusManagerTest.xaml</DependentUpon>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<UserControl
x:Class="UITests.Windows_UI_Xaml.DragAndDrop.DragDrop_Basics"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UITests.Windows_UI_Xaml.DragAndDrop"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">

<Grid x:Name="_theRoot">

<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<TextBlock Text="Source" />
<Border Background="DeepPink" Width="300" Height="300" Grid.Column="0" Grid.Row="1" CanDrag="True" x:Name="_theCustomSource">
<Border x:Name="_theNestedCustomSource" Background="LightPink" Width="100" Height="100" CanDrag="True" />
</Border>

<TextBlock Text="Target" Grid.Column="1" />
<Border Background="DeepSkyBlue" Width="300" Height="300" Grid.Column="1" Grid.Row="1" AllowDrop="True" x:Name="_theTarget">
<Border Background="DarkBlue" x:Name="_theNestedTarget" Width="100" Height="100" AllowDrop="True" />
</Border>

<Image Source="https://picsum.photos/300/300" Grid.Column="0" Grid.Row="2" CanDrag="True" x:Name="_theImage" ManipulationMode="All" />

<TextBlock Grid.Column="1" Grid.Row="2" CanDrag="True" x:Name="_theText" Text="Some text that can be dragged and dropped" />
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Linq;
using Windows.UI.Xaml.Controls;
using Uno.UI.Samples.Controls;

namespace UITests.Windows_UI_Xaml.DragAndDrop
{
[Sample]
public sealed partial class DragDrop_Basics : UserControl
{
public DragDrop_Basics()
{
this.InitializeComponent();
}
}
}

0 comments on commit 6bb7b16

Please sign in to comment.