UWP: Content Dialogs & Popups

I ran into an annoying visual problem with eclecdec, where a Popup that overlays (partially or entirely) a ContentDialog ends up with a gray translucent overlay at the intersection point of the two. Like this:

Popup before

While the gray translucent overlay doesn’t interfere with user interaction with the Popup’s controls, it’s annoying and ugly and looks sloppy.
It turns out that someone (not me) is adding a Shadow to the Border element that contains the ContentDialog’s content. It took me quite a while to find this using the Visual Studio Visual Tree Navigator. Once I did, it was a relatively simple matter to walk back up the visual tree (from an element in the content, not from the ContentDialog itself), find the offending Border element, and set the Shadow to null. Like this:


private void clearBorderShadow(UIElement childElement)
{
if (childElement != null)
{
DependencyObject child = childElement;
DependencyObject parent;

while ((parent = VisualTreeHelper.GetParent(child)) as UIElement != null)
{
if (parent is Border)
{
Border border = parent as Border;
if (border.Name == "BackgroundElement”)
{
border.Shadow = null;
break;
}
}

child = parent;
}
}
}

If you’ve subclassed ContentDialog, you can call this method in an Opened event handler. Or, you can call it before you open a Popup.

It’s goofy, and I still don’t know who is adding the Shadow, but I’m not willing to spend any more time looking. Most importantly, it works – safely:

Popup after

eclecdec Windows 1.4.26.0

This version is now in the Microsoft Store.

Changes:

Features

  • Add special character picker in rich text editor
  • Add first/last story navigation in rich text editor
  • Autosave current items, offer crash recovery
  • Allow note editing in sketch story editor
  • Create card now defaults to current filter setting

Fixes

  • Change to new MSFT AppCenter crash/usage reporting
  • Card Peek tab label on sketch editor should be simply Cards
  • Use same page transition for Sketch editor page as RTF editor page
  • Fix card text summary display not updating after card save
  • Use same Done indicator in sketch editor as RTF editor
  • Initial focus in non-story editor is now title
  • Fix error saving empty sketch card
  • Ensure rename of a project marks the project for sync
  • Rework navigation pane

eclecdec Windows 1.3.20.0

This version is now in the Microsoft Store.

Version 1.3.20.0 is a maintenance release that includes updated version of 3rd party components.

eclecdec Windows 1.3.16.0

This version is now in the Microsoft Store.

The primary (really, the only) goal of this version is to minimize the opportunity for data loss. Out of a years worth of use (by myself and others), I finally got that email that developers dread: data loss.

eclecdec stores projects in zip files (a la Word, Excel and PowerPoint). it’s a neat and tidy way to organize a set of files (metadata and content, to be precise) into a single package that you can easily move around.

But, as they say, “sh*t happens”. It could be a power loss, it could be a bug in the OS or in one of the myriad frameworks that we all use, it could be a bad sector on disk, or a cosmic ray or…even a bug in the app which, of course, is highly unlikely.

Regardless, data protection (or rather, mitigating the potential for data loss), is pretty critical. eclecdec already had a form of that with the ability to backup/restore/sync. But what if you don’t use these things, as so many of us don’t.

The solution, for eclecdec, was somewhat aggressive. I haven’t noticed any performance effects myself, and I write every day in it (and, just BTW, have never experienced any of the above problems).

Basically, whenever you open the project’s zip file, and before the open actually happens, eclecdec now examines the existing file for integrity. If it is ok, that file is saved. Effectively, eclecdec now keeps a rolling backup of “the last good file”. Kind of like Word does.

In the event that a project zip file has become corrupted for some reason, opening the project will substitute the last “backed up” version. This is different than backup/restore/sync since it happens behind the scenes. And doesn’t require explicit user action.

I think (and hope) that this aggressive tact prevents any more of the emails that I dread. Still, please, back up your data.

eclecdec Windows 1.3.7.0

This update is now in the Microsoft Store.

Features

  • Add ability to use a cover image in the project picker, because visual inspiration improves productivity
  • Move some global settings to “per-project” settings
  • Add next/previous story card navigation controls in Editor to facilitate reviewing

Fixes

  • Cards marked “done” will now appear in the card-peek lists in the Editor, with a “done” visual indicator

A couple of the features deserve some brief explanation.

One item that seems trivial but which has been “on the list” for a while is the ability to use images in the project picker:

Continue reading “eclecdec Windows 1.3.7.0”

eclecdec Windows 1.2.11.0

This update is now in the Microsoft Store.

Features

  • Find and replace in editor
  • Include score, definitions and word type in Better Words
  • Add the ability to have notes per Story card and folder

Fixes

  • Minor ribbon cleanup in editor
  • Mark done/not done tweaks in editor
  • Fix crash when printing from compiled view

eclecdec Windows 1.1.89.0

This update is now in the Microsoft Store, and is a fairly minor (in terms of what you can see) update.

Fixes:

  • Improved typing performance (specifically, periodic lag while typing at-speed) in the editor
  • Fixed average word count and estimated completion dates in Project Statistics.


eclecdec Windows 1.1.85.0

This update is now in the Windows Microsoft Store.

Features

  • In order to help answer the age old question “What’s a better word for some_word ?”, eclecdec now uses the Datamuse cloud service to offer word suggestions. This is available by clicking on the “Better Words” ribbon button in the Story Card editor.
  • Add the ability to edit the current card title in the Story Card editor. This is available by clicking on the “Title” ribbon button.
  • Added the ability Story Cards to be treated as individual chapters titled with their title, rather than scenes with chapter titles based on folders. This is configurable in Settings.
  • Reorganized editor ribbon.
  • The current card title is displayed as the window title when editing a Story Card.

Fixes

  • Improved selection in the editor. Selected text will remain visually selected when focus is changed. This is only fixed in the Windows 10 October 2018 update (1809).
  • Fixed a bug where project statistics could lump the word count for a day into the previous day’s count.
  • Minor wording fixes in project statistics display.

Windows UWP Version Adaptive Code

UWP applications are the constant recipients of new functionality. This is, obviously, a good thing for those of us who’d like to build a meaningful user experience a la WPF or WinForms.

My first experience with writing Version Adaptive Code comes as a result of trying to remove the super-annoying selection flyout in the RichEditBox (which, unsurprisingly, I use for editing in eclecdec). This appeared in the Windows 10 October 2018 Update (1809), and has been driving me crazy, because I already provide the formatting options in the eclecdec ribbon, and I find it gets in my way and disturbs my flow:

Continue reading “Windows UWP Version Adaptive Code”