Beispiel #1
0
        /// <summary>
        /// Highlights the <see cref="Note"/> controls for the specified <see cref="Person"/>.
        /// </summary>
        /// <param name="person">The person to highlight notes for.</param>
        public void FilterNotes(Person person)
        {
            // Each child control is a ContentPresenter that's wrapping a Note control.
            var children = Children;

            foreach (var noteContentPresenter in children)
            {
                Note               n  = GetVisualChild <Note>(noteContentPresenter);
                StickyNote         sn = n.DataContext as StickyNote;
                CompositeTransform ct = n.RenderTransform as CompositeTransform;

                if (sn.NoteIsFor.FriendlyName == person.FriendlyName ||
                    person.FriendlyName == App.EVERYONE ||
                    sn.NoteIsFor.FriendlyName == App.EVERYONE)
                {
                    // Make note totally not transparent.
                    BringNoteToFront(n);
                    n.Opacity = _opacityTop;
                    ct.ScaleX = _noteScaleTopX;
                    ct.ScaleY = _noteScaleTopY;
                }
                else
                {
                    // Make note a little transparent, ideally push it back into the z-dimension.
                    n.Opacity = _opacityMid;
                    ct.ScaleX = _noteScaleMidX;
                    ct.ScaleY = _noteScaleMidY;
                }
            }
        }
Beispiel #2
0
        public StickyNote CreateNote(Person person)
        {
            // Create the new note
            StickyNote newNote = new StickyNote(person);

            FamilyModel.StickyNotes.Add(newNote);
            return(newNote);
        }
Beispiel #3
0
        private static void NoteBusinessObjectPropertyChanged(DependencyObject dependencyObject,
                                                              DependencyPropertyChangedEventArgs ea)
        {
            Note       instance = dependencyObject as Note;
            StickyNote note     = ea.NewValue as StickyNote;

            instance.DisplayName = $"For: {note.NoteIsFor.FriendlyName}";
        }
Beispiel #4
0
        public StickyNote CreateNote(string nameTag)
        {
            // Create the new note
            StickyNote newNote = new StickyNote(nameTag);

            newNote.NoteIsFor = FamilyModel.PersonFromName(nameTag);
            FamilyModel.StickyNotes.Add(newNote);
            return(newNote);
        }
Beispiel #5
0
        public int CountNotes(Person person)
        {
            // Each child control is a ContentPresenter that's wrapping a Note control.
            var children = Children;
            int count    = 0;

            foreach (var noteContentPresenter in children)
            {
                Note               n  = GetVisualChild <Note>(noteContentPresenter);
                StickyNote         sn = n.DataContext as StickyNote;
                CompositeTransform ct = n.RenderTransform as CompositeTransform;

                if (sn.NoteIsFor.FriendlyName == person.FriendlyName)
                {
                    count++;
                }
            }
            return(count);
        }
Beispiel #6
0
 /// <summary>
 /// Delete a note from the collection of notes
 /// </summary>
 /// <param name="noteToDelete"></param>
 public void DeleteNote(StickyNote noteToDelete) => StickyNotes.Remove(noteToDelete);