Closed jublin closed 9 years ago
Awesome, I like using the enum, that's how I was thinking of doing it. Great idea with the Application Specific positioning. I had never thought of that. I'm going to add the same margin to the y values as you did to the x values. I'll create a new nuget package. Thanks for contributing!
I realized this morning that the function could have returned a point rather than a dictionary. I don't know what I was thinking last night, but I doubt it's very much difference in the long run/is easily changed.
Also I realized there could be primary screen and application screen locations (which end up being the same on single monitor setups, so I didn't really think of it until this morning either). It can probably wait until the custom controls change is in.
Yeah, I'll be messing with that after work, I don't know tons about custom controls so I'll have to play with it. Thanks for contributing!
After some research and playing around with Custom Controls it seems to me like they don't provide the desired functionality. At least my desired functionality. I made netoaster because I needed to inform the users of various situations programmatically from my code. A custom control requires the programmer to include it in their mark up. Seems kinda against what netoaster is. Am I thinking about it all wrong?
I think you'd need to define templates/styles and load each from a resource dictionary, with a different enumeration to get the default styles, with an enumeration for custom; which would attempt to look up the application resource with Application.Current.Resources.FindName(string), and do nothing if the resource didn't exist
Hmm alright, i'll keep looking into it. How would the programmer trigger the toasts? Would it use a xaml trigger?
Say they added the custom control like:
<netoaster:error Text="This is an error!" \>
Then how would the call it from the view? Seems like more work for the programmer. I'm not a huge .NET user so I probably don't understand the workflow.
They could always bind the text, but firing the toast off I'm not sure how it happen. Maybe it's better to leave as is, but only have one instance keyed off by style rather than 3 specific ones?
I agree. I'll refactor it so that you can select error,warn,success toast similar to how you did the positioning.
Sounds good. Let me know if you need help with anything on it/other things
I added enum animation support finally.
Changed Toasts to take an enumeration property for their position, and calculate that position with a helper function, rather than in each delegate (until toasts become custom control)