public override bool Equals(object o)
        {
            if (!(o is AddressAutocompletePrediction p))
            {
                return(false);
            }

            return(PlaceId != null && PlaceId.Equals(p.PlaceId) &&
                   PrimaryText != null && PrimaryText.Equals(p.PrimaryText) &&
                   SecondaryText != null && SecondaryText.Equals(p.SecondaryText));
        }
Beispiel #2
0
        /// <summary>
        /// Make additional formatting depending on data.
        /// </summary>
        void OnLoaded(Object sender, RoutedEventArgs e)
        {
            ApplyTemplate();

            // Special case - Title Tile
            String titlePlaceholder = "TitlePlaceholder";

            if (PrimaryText.StartsWith(titlePlaceholder))
            {
                TitleText.Text         = PrimaryText.Substring(titlePlaceholder.Length);
                TileLayout.Visibility  = Visibility.Collapsed;
                TitleLayout.Visibility = Visibility.Visible;
                return;
            }
            else
            {
                TileLayout.Visibility = Visibility.Visible;
                if (NoteImage)
                {
                    Note.Visibility = Visibility.Visible;
                }
            }

            // Special case - wrap text if primary and secondary texts are same
            if (PrimaryText.Equals(SecondaryText))
            {
                double rightMargin = 10.0;
                if (Note.Visibility == Visibility.Visible)
                {
                    rightMargin += Note.ActualWidth;
                }
                SecondaryTextBlock.Visibility = Visibility.Collapsed;
                PrimaryTextBlock.Margin       = new Thickness(4, 0, rightMargin, 0);
                PrimaryTextBlock.TextWrapping = TextWrapping.Wrap;
            }
        }