add GoToMapButton aund add them to Openinghours + change Mailbutton
This commit is contained in:
@@ -209,6 +209,7 @@
|
||||
<Compile Include="Utility\FileManager.cs" />
|
||||
<Compile Include="Utility\Logger.cs" />
|
||||
<Compile Include="Utility\HttpRequest.cs" />
|
||||
<Compile Include="Utility\Lui\Button\GoToMapButton.cs" />
|
||||
<Compile Include="Utility\Lui\Button\LinkButton.cs" />
|
||||
<Compile Include="Utility\StringManager.cs" />
|
||||
<Compile Include="Utility\URLList.cs" />
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
@@ -113,17 +114,13 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--mail button-->
|
||||
<Button Grid.Column="0" Tag="{Binding EMailTitle}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleEMail}" Click="EMailBtn_Click" Padding="0" Margin="-10">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.WebMail, Source={StaticResource ThemelizedIcons}}"/>
|
||||
</Button>
|
||||
<lui:EmailButton Grid.Column="0" EmailAddress="{Binding EMailTitle}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleEMail}" Padding="0" Margin="-10"/>
|
||||
<!--phone button-->
|
||||
<Button Grid.Column="1" Tag="{Binding PhoneTitle}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisiblePhone}" Click="PhoneBtn_Click" Padding="0" Margin="-10">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Phone, Source={StaticResource ThemelizedIcons}}"/>
|
||||
</Button>
|
||||
<!--location button-->
|
||||
<Button Grid.Column="2" Tag="{Binding Building}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleBuilding}" Click="LocationBtn_Click" Padding="0" Margin="-10">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Campus, Source={StaticResource ThemelizedIcons}}"/>
|
||||
</Button>
|
||||
<!--location button -->
|
||||
<lui:GoToMapButton Grid.Column="2" SearchTerm="{Binding Building}" BorderBrush="Transparent" Background="Transparent" Height="100" Visibility="{Binding VisibleBuilding}" Padding="0" Margin="-10" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
@@ -176,18 +176,6 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
phoneCallTask.Show();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called on clicking on a location button.
|
||||
/// </summary>
|
||||
/// <param name="sender">button object</param>
|
||||
/// <param name="e">event args</param>
|
||||
private void LocationBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrameworkElement tempUIElem = sender as FrameworkElement;
|
||||
|
||||
// TODO: open campusmap
|
||||
}
|
||||
|
||||
// private
|
||||
#endregion
|
||||
// Method
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="GoToMapButton.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>08.07.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Utility.Lui.Button
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Tasks;
|
||||
using System.Device.Location;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start the Webrowser, which an certain url
|
||||
/// </summary>
|
||||
public class GoToMapButton : System.Windows.Controls.Button
|
||||
{
|
||||
#region Members
|
||||
|
||||
/// <summary>
|
||||
/// Register the SearchTermProperty
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty SearchTermProperty = DependencyProperty.Register("SearchTerm", typeof(object), typeof(GoToMapButton), new PropertyMetadata(false));
|
||||
|
||||
/// <summary>
|
||||
/// Icon of the Button
|
||||
/// </summary>
|
||||
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Campus, UriKind.Relative));
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GoToMapButton" /> class.
|
||||
/// </summary>
|
||||
public GoToMapButton()
|
||||
: base()
|
||||
{
|
||||
this.Content = new Image
|
||||
{
|
||||
Source = icon
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Proberties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Url
|
||||
/// </summary>
|
||||
public object SearchTerm
|
||||
{
|
||||
get { return (object)this.GetValue(SearchTermProperty); }
|
||||
set { this.SetValue(SearchTermProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the OnClick-Method from button
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// now method start the WebBrowserTask
|
||||
/// </remarks>
|
||||
protected override void OnClick()
|
||||
{
|
||||
MapsTask mapsTask = new MapsTask();
|
||||
mapsTask.Center = new GeoCoordinate(51.766788, 14.326681);
|
||||
mapsTask.SearchTerm = this.SearchTerm as string;
|
||||
mapsTask.ZoomLevel = 15;
|
||||
mapsTask.Show();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace CampusAppWP8.Utility.Lui.Button
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// This class create an Button which start the Webrowser, which an certain url
|
||||
/// This class create an Button which start the WebBrowser, which an certain url
|
||||
/// </summary>
|
||||
public class LinkButton : System.Windows.Controls.Button
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user