Skip to content

Commit

Permalink
Removed the need to specify the namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmdelacruz committed Mar 24, 2017
1 parent c0073e6 commit a6ddf42
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 50 deletions.
5 changes: 4 additions & 1 deletion Map.Controls.RelativeLayout/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Markup;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -40,6 +41,8 @@
// app, or any theme specific resource dictionaries)
)]

[assembly: AssemblyVersion("0.1.*")]
[assembly: AssemblyVersion("0.1.1.*")]
[assembly: NeutralResourcesLanguage("")]

[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Map.Controls")]

63 changes: 31 additions & 32 deletions Map.Controls.Test.RelativeLayout/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,71 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Map.Controls.Test.RelativeLayout"
xmlns:controls="clr-namespace:Map.Controls;assembly=Map.Controls.RelativeLayout"
mc:Ignorable="d"
Title="MainWindow" Height="480" Width="640">

<controls:RelativeLayout>
<RelativeLayout>
<Grid x:Name="aqua"
Background="Aqua"
Width="150" Height="150"
controls:RelativeLayout.CenterInParent="True"/>
RelativeLayout.CenterInParent="True"/>

<Grid x:Name="bisque"
Width="20"
Background="Bisque"
controls:RelativeLayout.AlignParentBottom="True"
controls:RelativeLayout.AlignTop="aqua"
controls:RelativeLayout.ToRightOf="aqua"/>
RelativeLayout.AlignParentBottom="True"
RelativeLayout.AlignTop="aqua"
RelativeLayout.ToRightOf="aqua"/>

<Grid x:Name="darkBlue"
Height ="20"
Background="DarkBlue"
controls:RelativeLayout.Above="aqua"
controls:RelativeLayout.AlignLeft="aqua"
controls:RelativeLayout.AlignParentRight="True"/>
RelativeLayout.Above="aqua"
RelativeLayout.AlignLeft="aqua"
RelativeLayout.AlignParentRight="True"/>

<Grid x:Name="darkGoldenrod"
Background="DarkGoldenrod"
controls:RelativeLayout.AlignParentBottom="True"
controls:RelativeLayout.AlignParentRight="True"
controls:RelativeLayout.Below="darkBlue"
controls:RelativeLayout.ToRightOf="bisque"/>
RelativeLayout.AlignParentBottom="True"
RelativeLayout.AlignParentRight="True"
RelativeLayout.Below="darkBlue"
RelativeLayout.ToRightOf="bisque"/>

<Grid x:Name="blueViolet"
Width="20"
Background="BlueViolet"
controls:RelativeLayout.AlignParentTop="True"
controls:RelativeLayout.AlignBottom="aqua"
controls:RelativeLayout.ToLeftOf="aqua"/>
RelativeLayout.AlignParentTop="True"
RelativeLayout.AlignBottom="aqua"
RelativeLayout.ToLeftOf="aqua"/>

<Grid x:Name="darkCyan"
Background="DarkCyan"
controls:RelativeLayout.AlignParentTop="True"
controls:RelativeLayout.AlignParentRight="True"
controls:RelativeLayout.Above="darkBlue"
controls:RelativeLayout.ToRightOf="blueViolet"/>
RelativeLayout.AlignParentTop="True"
RelativeLayout.AlignParentRight="True"
RelativeLayout.Above="darkBlue"
RelativeLayout.ToRightOf="blueViolet"/>

<Grid x:Name="red"
Height="20"
Background="Red"
controls:RelativeLayout.Below="aqua"
controls:RelativeLayout.AlignRight="aqua"
controls:RelativeLayout.AlignParentLeft="True"/>
RelativeLayout.Below="aqua"
RelativeLayout.AlignRight="aqua"
RelativeLayout.AlignParentLeft="True"/>

<Grid x:Name="darkSlateGray"
Background="DarkSlateGray"
controls:RelativeLayout.AlignParentTop="True"
controls:RelativeLayout.AlignParentLeft="True"
controls:RelativeLayout.Above="red"
controls:RelativeLayout.ToLeftOf="blueViolet"/>
RelativeLayout.AlignParentTop="True"
RelativeLayout.AlignParentLeft="True"
RelativeLayout.Above="red"
RelativeLayout.ToLeftOf="blueViolet"/>

<Grid x:Name="darkTurquoise"
Background="DarkTurquoise"
controls:RelativeLayout.AlignParentBottom="True"
controls:RelativeLayout.AlignParentLeft="True"
controls:RelativeLayout.Below="red"
controls:RelativeLayout.ToLeftOf="bisque"/>
RelativeLayout.AlignParentBottom="True"
RelativeLayout.AlignParentLeft="True"
RelativeLayout.Below="red"
RelativeLayout.ToLeftOf="bisque"/>

</controls:RelativeLayout>
</RelativeLayout>

</Window>
26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,31 @@ Here's a snippet of the XAML code from the test application.

```xml
...
<controls:RelativeLayout>
<RelativeLayout>
<Grid x:Name="aqua"
Background="Aqua"
Width="150" Height="150"
controls:RelativeLayout.CenterInParent="True"/>
RelativeLayout.CenterInParent="True"/>

<Grid x:Name="bisque"
Width="20"
Background="Bisque"
controls:RelativeLayout.AlignParentBottom="True"
controls:RelativeLayout.AlignTop="aqua"
controls:RelativeLayout.ToRightOf="aqua"/>
RelativeLayout.AlignParentBottom="True"
RelativeLayout.AlignTop="aqua"
RelativeLayout.ToRightOf="aqua"/>

<Grid x:Name="darkBlue"
Height ="20"
Background="DarkBlue"
controls:RelativeLayout.Above="aqua"
controls:RelativeLayout.AlignLeft="aqua"
controls:RelativeLayout.AlignParentRight="True"/>
RelativeLayout.Above="aqua"
RelativeLayout.AlignLeft="aqua"
RelativeLayout.AlignParentRight="True"/>
...
```

## How to include in project
1. Download the DLL from [here](https://github.com/bmdelacruz/RelativeLayout/releases/download/0.1/Map.Controls.RelativeLayout.dll).
1. Download the DLL from [here](https://github.com/bmdelacruz/RelativeLayout/releases/download/0.1.1/Map.Controls.RelativeLayout.dll).
2. Add the downloaded DLL as a reference in your WPF Project.
3. In the XAML where you'd like to use the RelativeLayout control, do not forget to add the namespace.
```xml
xmlns:controls="clr-namespace:Map.Controls;assembly=Map.Controls.RelativeLayout"
```
4. You can now reference the RelativeLayout control in your XAML like this.
```xml
<controls:RelativeLayout></controls:RelativeLayout>
```

## Reference
### RelativeLayout's child properties
Expand Down

0 comments on commit a6ddf42

Please sign in to comment.