Click here to Skip to main content
15,915,757 members

Comments by FrontrunnerSoftwareIreland (Top 7 by date)

FrontrunnerSoftwareIreland 14-Dec-15 22:41pm View    
Perhaps it would, but that's not what is needed as the converter is required. The converter adapts the thickness based on the window size. In any case, I've already tried it with the converter removed and it makes no difference... the strange thing is, both the TemplateBinding and Binding RelativeSource structures work fine on a line further down the Template on the TextBlock for the Content and Fontsize values and the Fontsize also uses a Converter.
FrontrunnerSoftwareIreland 14-Dec-15 9:04am View    
I removed all star (*) references and tried to scale the entire page with a Viewbox as you suggested and all screen artefacts scaled correctly, but only after a pause of a few seconds whilst some Timer/Canvas based screen animations occur, that activate in the OnGotFocus method for the page. During this time the screen artefacts are not scaled correctly and look odd. This pause in the operation of Viewbox, renders it useless.
FrontrunnerSoftwareIreland 2-Dec-15 23:22pm View    
My App is a Universal Windows Store App. I created my app without any scaling code initially but had all sorts of problems getting fonts, margins and sizes to scale properly at differing screen resolutions. I then wrote a load of code to scale everything including button dimensions based on sizes relative to the screen size as that's the only solution I could find. I've tried Viewbox but it doesn't work correctly as it takes a number of seconds on app start to display the screen contents correctly and looks a mess until that happens. So I'm left with the solution I've got now which is code to change screen artefact size based on the screen resolution. It's a pain to do this but until someone suggests a better alternative, I'm stuck with it.
FrontrunnerSoftwareIreland 2-Dec-15 19:09pm View    
Sorry for any trouble I have caused.
I was trying to get the webpage to accept code in the comments which it doesn't appear to allow, so I reposted the comment as a solution so you could see it... When I did this, the webpage automatically accepted it as an answer and I did not spot that... sorry again :)
I've already marked your previous answer as accepted and noted from your comment that my use of star (*) values can be converted to explicit Width and Height values when using Viewbox which will simplify my code greatly... thanks very much for your help with that.
In future I will add code to the OP as you suggest... again my apologies.
Regards
Stuart
FrontrunnerSoftwareIreland 2-Dec-15 18:55pm View    
Hi Dave,
Thanks for the quick response.

The only method to call First() in my program that involves a predicate is trying to find the best available english speaking voice as follows:

public static string GetBestAvailableVoiceId()
{
var voices = GetVoicesList();

// Get first British voice...
var britishVoice = voices.First(v => v.Language.Contains("en-GB"));
if (britishVoice == null)
{
// Get first English voice...
var englishVoice = voices.First(v => v.Language.Contains("en"));
if (englishVoice == null)
{
// No english voices available...
Helpers.ModalPopupMessage(
Helpers.GetString("PM/B/Audio/GetSynthesizer/Error"),
Helpers.GetString("PM/T/Audio/Speech"));
}
else
{
return englishVoice.Id;
}
}
else
{
return britishVoice.Id;
}

return _synthesizer.Voice.Id;
}

So is it a call to GetVoiceList() returning null that is causing the problem or one of the First() predicates that is failing somehow?