Closed seb-giroux closed 4 years ago
Thank you very much for the idea! I've tried to recreate your idea, and the only thing I need is the About "screen". You mention you've done a lot of WPF, so could you give me a hint as to how such an overlay would be created?
If it was a web project, I'd merely create a div with a z-index higher than the background element, and then use Javascript to handle the user interaction. However, I find the transition from web-dev to WPF to be a bit more challenging than expected.
Here's what I've got so far, and it works with the "On" colors as well.
Oh and ps. What font are you using? It looks familiar to the default Windows 10 one, but with a very slight variation (the "Solo Play" part looks a bit more compact on your screenshot).
I decided to push the new design up to the master branch. Still need to make the "About" part work, but for now it opens up the repo via the default browser.
sry for the late reply, I think our timezone differs a bit :) SOLO PLAY is Arial Regular 14 OFF/ON is Arial Bold 18 Button Border is FACD00 and Fill is B78C25 @ 80% opacity (copied from Bungie website).
I'll get back to you for the "About" question.
I have a few questions, just to make sure I understand the implementation correctly.
You're creating a "DependencyProperty" on line 13 in the code-behind. I suppose this is much like the "require" keyword from php, where it acts as a way to import something? Then in the xaml code, you're using the local tag, this I guess means "Find something local to this namespace", and then it opens the "About" UserControl, due to its name, correct?
To show and hide the UC, you're using Binding right? And then using methods in the code-behind to set the value of the databound property?
DependencyProperties are special properties that you can bind to in order to be automatically notified when it changes. Kinda like "computed" in Vue.Js. They are meant to simplify the visual logic when you want to change your UI depending on a certain value or populate choices in a dropdown, etc.
And yes, "local:" is required because About doesn't exist in the default namespaces of WPF, contrary to the other controls used in this UserControl. It is automatically instantiated with the UserControl when created, but won't be rendered and displayed because its Visibility is bound to the Dependency and the default value is false.
One philosophy of WPF is that all visual logic should resides in the xaml, and code logic in the code-behind. Dependency Properties, Styles and their Triggers, DataContext, etc are all stuff that exist to help with this.
Alright, makes sense how you use the DepencendyProperties now. But could you explain how that differs from the "OnPropertyChanged" interface? The few times we've worked on WPF and needed to let the view know of a change, we've made use of the OnPropertyChanged.
You use the OnPropertyChanged if the code-behind needs to do something when that value changes. If only the UI needs to be notified, you use Bindings in the xaml to have the controls and properties talk to each other.
Alright, makes sense. Well, thank you for answering my questions, really do appreciate it!
Hi,
I thought about simplifying the app again for the user, as well as giving it a Bungie theme (it could also be based on the in-game color instead):
If you think it's a good idea, I could help (I've worked with WPF a lot).