add new icon to the page

This commit is contained in:
stubbfel
2013-09-12 11:43:18 +02:00
parent a3a8937028
commit b6140e240c
5 changed files with 162 additions and 14 deletions

View File

@@ -10,6 +10,7 @@ namespace CampusAppWP8.Model.Lecture
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWP8.Utility;
using CampusAppWP8.Resources;
/// <summary>
/// Model for a Activity
@@ -38,6 +39,24 @@ namespace CampusAppWP8.Model.Lecture
/// </summary>
private string topic;
/// <summary>URL of the icon.</summary>
private string iconUrl;
/// <summary>The activity icon name lecture.</summary>
private const string ActivityIconNameLecture = "Vorlesung";
/// <summary>The activity icon name seminar.</summary>
private const string ActivityIconNameSeminar = "Seminar";
/// <summary>The activity icon name pract.</summary>
private const string ActivityIconNamePract = "Übung";
/// <summary>The activity icon name lab.</summary>
private const string ActivityIconNameLab = "Labor";
/// <summary>The activity icon name exam.</summary>
private const string ActivityIconNameExam = "Prüfung";
#endregion
#region Constructor
@@ -184,6 +203,16 @@ namespace CampusAppWP8.Model.Lecture
}
}
/// <summary>Gets URL of the icon.</summary>
/// <value>The icon URL.</value>
public string IconUrl
{
get
{
this.CreateIconUrl();
return this.iconUrl;
}
}
#endregion
#region Methods
@@ -216,6 +245,38 @@ namespace CampusAppWP8.Model.Lecture
this.CourseString = StringManager.RemoveNewLine(result);
}
/// <summary>Creates icon URL.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
private void CreateIconUrl()
{
string typeStr = this.Type;
if (typeStr.Contains(LectureActivity.ActivityIconNameLecture))
{
this.iconUrl = Icons.Lecture;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameExam))
{
this.iconUrl = Icons.Exams;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNamePract))
{
this.iconUrl = Icons.Practise;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameSeminar))
{
this.iconUrl = Icons.Info;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameLab))
{
this.iconUrl = Icons.Lab;
}
else
{
this.iconUrl = Icons.Info;
}
}
#endregion
}
}

View File

@@ -47,9 +47,12 @@
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left">
<TextBlock Text="{Binding Type}" TextAlignment="Left" HorizontalAlignment="Left" />
<TextBlock Text=" : "/>
<StackPanel Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Type}" TextAlignment="Left" HorizontalAlignment="Left" />
<TextBlock Text=" : "/>
</StackPanel>
<Image Source="{Binding IconUrl}" Width="50" />
</StackPanel>
<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Grid.Column="1" Grid.Row="0"/>
</Grid>

View File

@@ -33,6 +33,17 @@ namespace CampusAppWP8.Resources
}
}
/// <summary>
/// Gets the uri string of the AddContact icon.
/// </summary>
public static string AddContact
{
get
{
return Themerize("add_contact_159.png");
}
}
/// <summary>
/// Gets the uri string of the Campus icon.
/// </summary>
@@ -176,6 +187,17 @@ namespace CampusAppWP8.Resources
}
}
/// <summary>
/// Gets the uri string of the Lab icon.
/// </summary>
public static string Lab
{
get
{
return Themerize("lab_159.png");
}
}
/// <summary>
/// Gets the uri string of the Lamb icon.
/// </summary>
@@ -187,6 +209,17 @@ namespace CampusAppWP8.Resources
}
}
/// <summary>
/// Gets the uri string of the Lecture icon.
/// </summary>
public static string Lecture
{
get
{
return Themerize("lecture_159.png");
}
}
/// <summary>
/// Gets the uri string of the Lectures icon.
/// </summary>
@@ -275,6 +308,17 @@ namespace CampusAppWP8.Resources
}
}
/// <summary>
/// Gets the uri string of the Practise icon.
/// </summary>
public static string Practise
{
get
{
return Themerize("practise_159.png");
}
}
/// <summary>
/// Gets the uri string of the Schedule icon.
/// </summary>
@@ -308,6 +352,17 @@ namespace CampusAppWP8.Resources
}
}
/// <summary>
/// Gets the uri string of the Seminar icon.
/// </summary>
public static string Seminar
{
get
{
return Themerize("seminar_159.png");
}
}
/// <summary>
/// Gets the uri string of the StudentCouncil icon.
/// </summary>

View File

@@ -120,6 +120,9 @@
<data name="Add" xml:space="preserve">
<value>add_159.png</value>
</data>
<data name="AddContact" xml:space="preserve">
<value>add_contact_159.png</value>
</data>
<data name="Campus" xml:space="preserve">
<value>campus_159.png</value>
</data>
@@ -159,9 +162,15 @@
<data name="Info" xml:space="preserve">
<value>info_159.png</value>
</data>
<data name="Lab" xml:space="preserve">
<value>lab_159.png</value>
</data>
<data name="Lamb" xml:space="preserve">
<value>info_159.png</value>
</data>
<data name="Lecture" xml:space="preserve">
<value>lecture_159.png</value>
</data>
<data name="Lectures" xml:space="preserve">
<value>lectures_159.png</value>
</data>
@@ -186,6 +195,9 @@
<data name="Pig" xml:space="preserve">
<value>info_159.png</value>
</data>
<data name="Practise" xml:space="preserve">
<value>practise_159.png</value>
</data>
<data name="Schedule" xml:space="preserve">
<value>schedule_159.png</value>
</data>
@@ -195,6 +207,9 @@
<data name="SearchPlace" xml:space="preserve">
<value>search_place_159.png</value>
</data>
<data name="Seminar" xml:space="preserve">
<value>seminar_159.png</value>
</data>
<data name="StudentCouncil" xml:space="preserve">
<value>student_council_159.png</value>
</data>

View File

@@ -1,19 +1,28 @@
using CampusAppWP8.Resources;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
//-----------------------------------------------------------------------
// <copyright file="AddPersonButton.xaml.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>09.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Utility.Lui.Button
{
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using CampusAppWP8.Resources;
/// <summary>Add person button.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
public class AddPersonButton : System.Windows.Controls.Button
{
private static BitmapImage icon = new BitmapImage(new Uri(Icons.Add, UriKind.Relative));
/// <summary>The icon.</summary>
private static BitmapImage icon = new BitmapImage(new Uri(Icons.AddContact, UriKind.Relative));
/// <summary>Initializes a new instance of the AddPersonButton class.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
public AddPersonButton()
: base()
{
@@ -23,17 +32,22 @@ namespace CampusAppWP8.Utility.Lui.Button
};
}
/// <summary>The person identifier property.</summary>
public static readonly DependencyProperty PersonIdProperty = DependencyProperty.Register("PersonID", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
/// <summary>The function index property.</summary>
public static readonly DependencyProperty FunctionIndexProperty = DependencyProperty.Register("FunctionIndex", typeof(object), typeof(AddPersonButton), new PropertyMetadata(false));
/// <summary>Gets or sets the identifier of the person.</summary>
/// <value>The identifier of the person.</value>
public object PersonId
{
get { return (object)this.GetValue(PersonIdProperty); }
set { this.SetValue(PersonIdProperty, value); }
}
/// <summary>Gets or sets zero-based index of the function.</summary>
/// <value>The function index.</value>
public object FunctionIndex
{
get { return (object)this.GetValue(FunctionIndexProperty); }