Addresser.cs (2900B)
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using Windows.UI.Xaml; 7 using Windows.UI.Xaml.Controls; 8 using Windows.UI.Xaml.Media; 9 using WinRTXamlToolkit.Controls; 10 namespace File360 11 { 12 public class Addresser:StackPanel 13 { 14 public bool root = true; 15 public void InitializeComponent() 16 { 17 HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left; 18 VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center; 19 Orientation = Windows.UI.Xaml.Controls.Orientation.Horizontal; 20 //StackPanel stk = new StackPanel(); 21 //stk.Orientation = Windows.UI.Xaml.Controls.Orientation.Horizontal; 22 //TextBlock content = new TextBlock(); 23 //TextBlock txt = new TextBlock(); 24 //stk.Children.Add(content); 25 //stk.Children.Add(txt); 26 //prev.Content = stk; 27 28 } 29 30 public bool Root 31 { 32 get { return root; } 33 set { root = value; } 34 } 35 36 public void Address(string value, string path) 37 { 38 Button current = new Button(); 39 current.BorderThickness = new Thickness(0); 40 StackPanel currentStk = new StackPanel(); 41 currentStk.Orientation = Windows.UI.Xaml.Controls.Orientation.Horizontal; 42 TextBlock content = new TextBlock(); 43 TextBlock txtH = new TextBlock(); 44 current.Content = currentStk; 45 txtH.FontFamily = new FontFamily("Assets/Font/iconFont.ttf#iconfont"); 46 txtH.Text = "."; 47 txtH.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center; 48 txtH.FontSize = 10; 49 //txtH.Foreground = (SolidColorBrush)Application.Current.Resources["PhoneAccentBrush"]; 50 //content.FontFamily = new FontFamily("Assets/Font/Custom/Raleway-Light.ttf#Raleway"); 51 content.TextLineBounds = TextLineBounds.Tight; 52 content.TextAlignment = TextAlignment.Center; 53 content.Text = value; 54 currentStk.Children.Add(content); 55 currentStk.Children.Add(txtH); 56 current.Background = null; 57 current.Height = this.ActualHeight; 58 current.MinWidth = 0; 59 current.Tag = path; 60 Children.Add(current); 61 root = false; 62 } 63 public void Reset() 64 { 65 Children.Clear(); 66 } 67 public void RemoveLast() 68 { 69 Children.RemoveAt(Children.Count - 1); 70 if (Children.Count == 0) root = true; 71 else root = false; 72 } 73 public void SelectedFolder(int foldersNo) 74 { 75 for (int i = Children.Count-1; i < (Children.Count-foldersNo-1); i--) 76 { 77 Children.RemoveAt(i); 78 } 79 } 80 81 } 82 }