private void DgBookings_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (dgBookings.SelectedItem != null)
     {
         _title = new ContentTitle("Vis booking");
         ContentControlTitle.Content   = _title;
         ContentControlAddEdit.Content = new ShowBooking(_fService.GetBookingByID(GetSelectedBookingID()));
     }
 }
Example #2
0
 private async Task TitleAnimation()
 {
     await ContentTitle.FadeTo(1, 1250, Easing.SpringIn);
 }
        public List <Content> makeContent(String s)
        {
            // int temp = 0;
            List <Content> l      = new List <Content>();
            bool           swLoop = true;
            ContentNext    cn     = new ContentNext(TypeContent.Null, 0, "");

            while (swLoop)
            {
                cn = _nextContent(s);
                if (cn.Type == TypeContent.Null)
                {
                    s      = "";
                    swLoop = false;
                }
                else
                {
                    if (s.Length >= cn.NextPos)
                    {
                        s = s.Substring(cn.NextPos);
                        switch (cn.Type)
                        {
                        case TypeContent.TypeTitle:
                            string content    = "";
                            double size       = 18.0;
                            int    startIndex = 0;
                            int    endIndex   = 0;
                            // Size
                            var test = cn.Content.IndexOf(STARTTAGSIZ);
                            startIndex = cn.Content.IndexOf(STARTTAGSIZ) == -1 ? 0 : cn.Content.IndexOf(STARTTAGSIZ) + STARTTAGSIZ.Length;
                            endIndex   = cn.Content.IndexOf(ENDTAGNES, startIndex);
                            bool swValidTitle = (startIndex > 0) && (endIndex - startIndex) > 0;
                            if (!swValidTitle)
                            {
                                content = cn.Content;
                            }
                            else
                            {
                                // Mod of dart
                                //switch (cn.Content.Substring(startIndex, endIndex))
                                switch (cn.Content.Substring(startIndex, endIndex - startIndex))
                                // End mod of dart
                                {
                                case "1":
                                    size = TITLESIZ1;
                                    break;

                                case "2":
                                    size = TITLESIZ2;
                                    break;

                                case "3":
                                    size = TITLESIZ3;
                                    break;

                                default:
                                    size = TITLESIZ2;
                                    break;
                                }
                                if (cn.Content.Length >= endIndex + ENDTAGNES.Length)
                                {
                                    content = cn.Content.Substring(endIndex + ENDTAGNES.Length);
                                }
                            }
                            ContentTitle itemTitle = new ContentTitle(content, size);
                            l.Add(new Content(TypeContent.TypeTitle, itemTitle, null, null, null));
                            break;

                        case TypeContent.TypeText:
                            bool   swLoop2 = true;
                            String string2 = cn.Content;
                            List <ContentTextRich> listRich = new List <ContentTextRich>();
                            ContentNextTextRich    cntr     = new ContentNextTextRich(FontStyle.Normal, FontWeight.Normal, 0, "");
                            while (swLoop2)
                            {
                                if (cntr.FontStyle == FontStyle.Null || cntr.FontWeight == FontWeight.Null)
                                {
                                    string2 = "";
                                    swLoop2 = false;
                                }
                                else
                                {
                                    if (string2.Length >= cntr.NextPos)
                                    {
                                        string2 = string2.Substring(cntr.NextPos);     // Init at 0
                                        cntr    = _nextContentRichText(string2);
                                        if (cntr.Content != null)
                                        {
                                            listRich.Add(new ContentTextRich(cntr.Content, cntr.FontStyle, cntr.FontWeight));
                                        }
                                        else
                                        {
                                            string2 = "";
                                            swLoop2 = false;
                                        }
                                    }
                                    else
                                    {
                                        string2 = "";
                                        swLoop2 = false;
                                    }
                                }
                            }
                            ContentText itemText = new ContentText(listRich);
                            l.Add(new Content(TypeContent.TypeText, null, itemText, null, null));
                            break;

                        case TypeContent.TypeSvg:
                            ContentSvg itemSvg = new ContentSvg(cn.Content);
                            l.Add(new Content(TypeContent.TypeSvg, null, null, itemSvg, null));
                            break;

                        case TypeContent.TypePng:
                            ContentPng itemPng = new ContentPng(cn.Content);
                            l.Add(new Content(TypeContent.TypePng, null, null, null, itemPng));
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        s      = "";
                        swLoop = false;
                    }
                }
            }
            return(l);
        }