Jon (00:06.318) Welcome back to another gummobile. Hey Alan, what what kind of coffee drinking today? Allan Ritchie (00:11.927) You know what kind of coffee I'm drinking. You call it my swill. You call it, uh, I drink, I drink my Keurig. I mean, John would have me buying a machine that measures the atomic weight of a hair and has some sort of shower thing that drips into it. And then it's got like this, this glass with like this, the leather is made from the same stuff. They make Kobe beef. So I don't know. Yeah. That's. Jon (00:15.118) Yeah, I mean, that's that's being kind. Jon (00:38.126) Yeah. That's the particular one that I like to use, yeah. Allan Ritchie (00:42.071) It's called Chemex, right? Is that the? Okay, so it's a chemistry station is what it is. Jon (00:49.262) Yeah, I mean, it's, but you know what? It's back to like the simple days of making coffee. It's just the basics, right? It's water. Allan Ritchie (00:55.958) except it takes you, how long does it take you to make a cup of coffee, John? No, no, how long? Jon (00:59.054) It doesn't take that long. It's like 40 seconds to grind the beans and then the water is heating up while that happens, right? Allan Ritchie (01:06.792) Yeah, and the beans also need a special grinder too. You can't just be a blackenedekker because you made fun of my blackenedekker. Jon (01:11.246) Well, just you can't just smash them with a hammer or something, right? Like you, yeah, you want, no, you have a spice grinder and you don't have a coffee grinder. The ones with the blades. Well, they, they, they lied to you. I'm sorry to tell you. Allan Ritchie (01:16.405) No, I have a grinder, but you said it's that swill too. It says coffee grinder right on it. Yes. Okay, okay, so okay, so going back to how long it takes you how long do you before you have a cup to mouth? Jon (01:29.678) But that - Maybe five, six minutes tops. Yeah. No, no, no. But you know what? It, this actually reminds me. Did I ever tell you about the, um, the coffee scale that I was building? I think I did. Right. Maybe. Yeah. Yeah. We should, we should do an episode on iot .net stuff too. Allan Ritchie (01:35.445) No, you've told me over and over 15 minutes. Allan Ritchie (01:46.388) Yes, I remember your IoT project. Allan Ritchie (01:52.531) Is that going to, that's a good idea. Is that going to measure the atomic weight of your coffee and water at the same time too? Jon (01:58.574) Uh, that's where I kind of ran into problems is I needed to find a better, so yeah, I mean that was good, good, uh, content for another episode, right? Like talking about, I love the interaction of like the real world stuff with programming. Uh, but I had, I had to figure out a better way to, um, do the scale part of it. The thing that I used was not, not accurate enough at all. I mean, you know, it was at least a couple of hairs off. So. Allan Ritchie (02:14.354) Fair enough. Allan Ritchie (02:22.899) Yeah, yeah, I enjoy my coffee because it takes about 30 seconds to make it. And then it you know, I add water, it tells me when I've done something stupid, it tells me when I need to clean it. I am a dumbass when it comes to coffee. And I am all right, because again, it's 30 seconds from cup to mouth. Done. Jon (02:23.502) Microns or something. Jon (02:40.718) One day maybe we'll we'll fix that but it's not gonna be today Speaking of other things that maybe one day we'll fix Allan Ritchie (02:44.691) see we'll see. But you know we take maybe maybe but at least we can talk about it right? The wonderful world of XAML. The wonderful world. Now I like XAML I'm gonna be honest I am a XAML sympathizer. I Jon (02:53.774) Yeah. Ooh, XAML. Jon (03:02.542) I think you either love it or you hate it as a person. Allan Ritchie (03:06.132) I mean, I do a lot of React. I've done a lot of the encode stuff like from community toolkit and stuff. I love it. I love the community toolkit code. I do love my React. I guess I'm just I'm not picky. But XAML is very verbose. And some of the stuff I see in XAML, there's a customer I'm working with right now who I love. They're fantastic. But they have a love for XAML, like a deep love for XAML. And Jon (03:24.398) Yeah. Jon (03:33.422) They like put everything in, you know, like, so do you, with your XAML, do you put like, like how serious are you? Do you put, um, like all of your, like, I, you know, I see some people stick like the view model declaration in the binding context in the XAML file, right? Like, so that's all markup, which you can totally do. You probably don't cause then, yeah, I don't. I'm just saying I've seen it. Allan Ritchie (03:52.276) But then you negate your DI. Yeah, don't do that. Don't do that. OK. They don't do that. Thankfully, they are on the DI bus for their view models and stuff. But they have a love for everything being in XAML. And I'm like, my dudes, we've got to get to the view models, man. Do you know why? Jon (04:04.334) Mm -hmm. Allan Ritchie (04:14.772) because they're very easy to unit test. And these guys love their code coverage, like in other projects in their server side, they love their, you know, all those metrics coming in and they love being able to test it right there. But the more you get into the XAML with stuff like converters, right? The more you get over there, the more kind of, I don't want to call it spaghetti, but certainly separated code bits. Jon (04:21.582) Mm -hmm. Jon (04:34.35) Oh. Allan Ritchie (04:42.771) And it goes more over to the UI, right? And really, it's like, do as much as you can in that view model. I mean, call me wrong. Jon (04:44.992) Yeah. Jon (04:49.23) Well, yeah. And that's, well, that's, I mean, if you're talking to maybe some, you know, purist and how you're separating your concerns of things there, right? Like that's something that I feel like I've seen so many people over the years be like, wow, you shouldn't, you shouldn't put that in the view model. Cause that's like the place that, you know, is more your, your pristine business logic that shouldn't have anything to do about how the view is constructed. And it's like, yeah. Um, but at the end of the day, if, if you're choosing sometimes between, I need to get this thing, you know, into my, my XAML and either I have to write yet another converter or I just like add one more property that maybe just even as a read only wrapper around something else, like, I don't know. Allan Ritchie (05:36.979) Do you how many converters on average do you have? Just a ballpark. Jon (05:40.59) So I mean on average is hard because I don't really have many apps, right? I have one app so I have my average is skewed by the one app. I have a lot of converters in it. I don't know if I've counted them. No, no, no, no, no, but, but, but, but this is because I carried a lot of legacy stuff over from my early days of building this app where, you know, it was like, Oh yeah, you're supposed to write converters to do this. You shouldn't, you know, add a property that inverts the, the Allan Ritchie (05:50.162) Well, let's. Jon (06:09.806) the Boolean property on your view model because that's not the right way to do it. That's not the pure way to do it. Um, so I had, I have some of that kind of stuff and I have some interesting ones. I think I mentioned the one to you where I've got, this might be over engineered. I'll be willing to wager that, but I have a, because I'm doing blazer web, right? Wasm and I'm doing Maui. I have a formatted, so Maui has the concept of a formatted string. Allan Ritchie (06:32.69) Mm -hmm. Mm -hmm. Jon (06:39.15) I know is, I think it's formatted string, right? That's the name. Okay. Because I'll get to this in a second. Anyway, the formatted string is basically a way for you to have a bunch of text in a label without having a bunch of labels. So like in my pool app, I have, um, like in my, my log timeline, one of my logs is like, Oh, you added X amount of Y chemical, you know, at Z strength to your pool. Allan Ritchie (06:42.002) Yes. Jon (07:08.686) And so I want to, I have all that information. I want to display that. And I want to have like the chemical amount to be like maybe, um, slightly bolder and maybe a different color than the chemical type. Cause the chemical types, I, I try and group by kind of like what they impact, like what, what measure of the pool chemistry they impact. So all of the ones that impact like the chlorine levels are a certain color. And then I have, um, the amount. Did I say the amount? I had the amount. I don't know. There's a, there was another piece there. Allan Ritchie (07:39.219) doesn't matter there's a whole bunch of bound properties that you have. Jon (07:43.438) Right. So like I could do those all in individual properties on the view model. Um, and I could have three or four different labels to in a layout to set that all up or, or I can have one label, right? And all of the platforms have some concept of this kind of, um, label that has like, you know, spans of texts that are different styles and stuff. So Android does this, uh, windows does this, iOS does this. And so. It's more performant to do one label like that than to have a bunch of Maui labels that create, you know, several more instances of the, the native control to back them and do all that. So I think there's a good reason for me for, to use the format string and for others to do so as well. So coming back to the whole, you know, converter thing to make that all abstracted across like web and Maui, I introduced a new thing called that I call formatted text, which is why I always confuse the name with. formatted string because I'm like, which one is the native one? And so formatted text like takes the concept of what's the font size, the color, the font itself. And then it gets even more crazy when you start introducing, like I have a lot of font icons and I'll mix those in with those into the labels too, right? So I might have like a font icon and I use a symbol character to show like, I don't know, the some, Well, actually I do this for weather conditions. So I'll do one label and I'll have like a cloud if it's cloudy or a sun, if it's sunny or rains, if it's, you know, raindrop, if it's rainy and I'll mix that in with like the temperature value and the wind speed and all the different stuff there. So multiple fonts and stuff. So I abstracted that all out. And then at the end of it all, I have a converter that takes a formatted text object and converts it into a formatted string. I think that's an okay use of it. Allan Ritchie (09:39.06) You're definitely going to have the purists throwing spears at you. Well, that's the other thing. Do what works for you. Now the other... Jon (09:43.502) Yeah, who cares. Jon (09:48.59) Right. And it works for me in both places, right? Like if it's on the blazer side, it actually worked out well. I'm like, oh, I got this thing. I just turn it into whatever, you know, HTML or whatever things I need to do there. And it all just comes together. It's lovely. Yep. Allan Ritchie (10:01.908) it renders hey if it works it works but let's be fair you can go nuts with converters so I've seen projects with many converters many many like I want to say the worst I've seen is like 40 40 converters oh dear oh I so Jon (10:22.254) I probably have more than that. But again, like I could probably do an audit and get rid of half of them and live life happily. Allan Ritchie (10:31.412) I get by with two and the only reason I have two is for easy reasons. One is inverse of Boolean. Everybody has that. I wish it was built into XAML. I could do it with data triggers and all that stuff but it gets kind of... Jon (10:40.366) Yeah. Jon (10:45.806) Isn't community toolkit ships a bunch of those now too, right? Allan Ritchie (10:50.149) Yeah, but everybody, I think everybody and their uncle has an inverse bool or calls it like not or something, right? But yes, it's out of the box in community toolkit. Thank God, because I think just about everybody uses it. Jon (10:53.614) Right, because it, yeah. Jon (11:01.55) Ooh, there's a, talking about a lot of converters. They have a lot, they have probably 40 converters in there now too. Allan Ritchie (11:08.083) Well whatever you love I guess. I'm gonna say though that I have seen a lot of business logic leak into them. I've seen a lot of like I mean so going back to the two I have. I have the inverse obviously everybody has that and I have a double. Yeah you okay okay well you knew. He already knew. Jon (11:10.254) I mean, yeah. Jon (11:23.31) Can I guess the other one? Oh, I was going to guess it. Well, I know that's the actual answer, but I was going to suggest that. Are you really just, you have one converter and one of your converter parameters is like, what's the type of converter? And then you just have a mega converter. Yeah. Yeah. Allan Ritchie (11:37.682) It's a double to like a numeric, right? So I can check the target. Not a big deal. It's just cause double doesn't come out of the box in binding for Maui or Xamarin Forms. So I've had it for a long time. It's a very minor thing. Jon (11:47.95) Mm -hmm. Jon (11:51.47) And nullable numbers can be a pain too with out of the box. I have some of those, right? Nullable double converter. Allan Ritchie (12:01.457) I think there's other ways I deal with that though. I don't usually tend to bind nullable I'm able to tell like dates fine you could say dates there's some weird stuff you got to do there. There's cases right now where I do date only or time only which I wish came out of the box but it doesn't it's still minor. Usually in the in the view model I can end up flipping those over to you know just to my DTOs manually anyway so not a big deal. Jon (12:03.982) Maybe. Jon (12:14.702) Okay, yep. Mm -hmm. Allan Ritchie (12:30.385) It is what it is. But like I said, I've seen places where a lot of business logic begins to leak in these, like this specific enum to this specific value, right? And that doesn't work because enums grow, right? So you don't really want to start mixing too much of that stuff. What's another good one? Well, like you said, nulls to just about everything, enums to just about everything. Jon (12:40.046) Yeah. Jon (12:56.27) I have had a case and I don't remember the specifics. I know I've done like something like bool to grid length or something like that. Like where, well, no, but there was a good case for it where I think if I, well it was visibility, but if I didn't do it that way, my layout became enormously more complex or nested. So I was like, I really do want to use a grid and I just want to hide. Allan Ritchie (13:08.977) See, that's weird. Why? Allan Ritchie (13:13.841) Visibility. Jon (13:25.614) you know, some columns so they collapse or some rows so they collapse. So yeah. Allan Ritchie (13:31.506) Now for some of these things, you could do data triggers. The problem with those is that you'll develop carpal tunnel syndrome really quick having to do those. It's very verbose. It's a lot of flipping typing. And they don't always reset the same way. You have to have all of the stuff you change reset back. And a lot of people don't realize that. It doesn't just kind of. Jon (13:34.382) Mm -hmm. Jon (13:45.166) Mm -hmm. Allan Ritchie (13:55.73) return. So you end up with you end up mapping both sides of the equation fully to do the things you want to do. And it's a lot of typing. It's huge. Now, the other thing I tend to see people use is and I don't use these at all. So maybe I'm stupid, but I don't use like XAML extensions at all. Like they're just at all. Jon (13:56.11) Yeah, yeah, yeah. Jon (14:18.446) Like, like, like to give me an example of ones that you see. Allan Ritchie (14:21.522) Localization is the biggest one. Now people do localization different. I am hardcore that belongs in the view model because a lot of stuff, a lot of the messages you're going to format, a lot of the validation is going to come out of your view model. Right. So I'm not big on that being separate for the case of the page because my view model is going to have to deal with it anyways. So what I've been doing is notoriously binding with against the dictionary. Right. So dictionary strings and you can go binding. Jon (14:23.598) Okay. Allan Ritchie (14:51.025) Brace bracket, the value, close brace bracket, and it binds. And that's it. It works beautiful. And then you can, if it's in the dictionary, there you go, right? It just, it's out of the box. It's very easy. I don't need an extension. It's just a normal binding. Jon (15:06.862) Yeah. Well, and I think, um, what, what was, I haven't looked at it, the code in a while, but like you, you built into shiny the localization, the source generator thing is that, are you like shipping that as a thing yet? Like, I know it's on new get as a preview cause I'm using it. Cause you built it for me. Cause cause you're nice and see, I do use other people's stuff sometimes. Allan Ritchie (15:20.146) Mm. Allan Ritchie (15:25.969) Well, it was, but to be fair, it's cause you wanted the strongly typed keys, but with the dependency injected values. Now I dependency inject my localization, not because I believe that it needs to be separated, but I've had two massive projects where we had a multi -tenanted set up and the customer, you know, they're, if they're paying a million bucks, man, you're pretty much going to do whatever they ask, right? So we had certain tenants that wanted certain wording for certain fields. Jon (15:30.766) Mm -hmm. Jon (15:42.766) Mm -hmm. Allan Ritchie (15:53.808) So you know shipping the out of the box resource files didn't work for them so we had to get rich right and then localizations would kind of come in over time and you had Quebec French that didn't match France French because apparently Quebec French is fake which I'm not surprised right so controversy don't shoot me I'm Canadian and I'm an hour from the border. Jon (16:06.574) Oh yeah. Jon (16:13.646) No, it's funny because like, you know, we, we obviously grew up learning, um, Quebec French in school. I mean, I, I'm assuming that you, they taught you French too. We're not that far different in age. Um, and you know, then you would know a little bit and like, I just remember going to, to France a handful of times and like any, anything you tried to speak there, like one, I know you're not French at all to, I know you're trying to speak French, but it's like Canada, French, it's Quebec French. Allan Ritchie (16:21.39) Right. Yep. Right. Jon (16:43.566) And then the vice, the opposite, right? You go to Quebec and they're like, you know, if you didn't speak the Quebec French, get out of here. Yeah. Allan Ritchie (16:43.663) Indeed. Allan Ritchie (16:50.543) They know, yeah. So, but as Canadians, we're very accustomed to having to do localization, right? So you had to have strongly typed keys, which I get, you know, it's gotta be that way, but you still had to have the dependency injection just in case. So a lot of people are using extensions for that. I hate it because it takes away again from my view model and my view model is gonna use those keys anyways. So I wish people would stop doing it. Jon (16:56.494) Right. Jon (17:06.446) Yep. Yep. Allan Ritchie (17:19.31) wish. But again, pick what works. Jon (17:19.374) Yeah, no, I really like the way that it's set up with the source generator and stuff. I think that's a nice thing. And like localization is just hard, you know, no matter what. So it's a... Allan Ritchie (17:25.358) Ahem. Allan Ritchie (17:31.31) I guess I'm so used to it now it doesn't really phase me anymore. It's just a lot of extra copying and pasting, which I hate. Jon (17:37.71) Well, but, but even like, I mean, like maybe there's another, another episode idea, localization, like we could do, I remember back in the Xamarin days, this being a thing and there was, there was a tool at one point that you could go, that would go in like find any strings that you used in the source code, extract that out, make that like the, the localization, you know, resource dictionary, whatever you want to call it. And then you would go get translations and it knew how to like inject those back in and stuff. Right. But there was, Like even resource files, I believe there's still cases that that doesn't really fully solve. So yeah, there's probably room for doing more interesting things there with your source generator and again, not using extensions. Allan Ritchie (18:21.452) I wonder if AI has improved auto -localization now. Jon (18:24.622) Maybe, well yeah, it's a whole other thing too, right? It's like, oh yeah, I'm just gonna go like use Google Translate. It's like, yeah, that might not be the best idea if you don't have anybody who knows like how to look at, verify the results. Allan Ritchie (18:37.358) You know, I did that in the past and then I handed those translations off to somebody that was like full French here in Canada and they were like, what is this? Now this is going back literally 20 years ago. Okay. So I'm pretty sure that things have come a lot further, but that's how I did it. I translated and they were like, what is this? Jon (18:39.278) Mm -hmm. Jon (18:49.838) Yeah. Jon (18:53.454) Probably. Yeah. Well, that's, that's an interesting idea. Cause like, yeah, you could almost, I feel like if you could give copilot or whatever GPT, whatever model you're using, um, like a, you know, give them your, your strains to translate, but then give it like a blurb of context, right? It's probably going to do an okay job. Even if you said like, Hey, this is, you know, this, this entry is for a button in an app that talks about doing this. Like, you know, and then they would be able to translate it to another language with that context. Allan Ritchie (19:26.702) There we go. Hmm. I bet you they tell you not to use a XAML extension to do it though. Hmm. Jon (19:28.014) That's an idea. Jon (19:32.846) I bet you're right. Copilot probably is like, here you go, but just whatever you do, don't you dare use that XAML extension. Yep. Allan Ritchie (19:40.878) There you go. See, that's all I'm saying. Less stabilization, more view modeling. Jon (19:46.862) Yeah. Well, and so can you back to the, the whole converter thing. Okay. So you have two converters there. There is some, there's going to be people on both sides of the camp, right? Of like, do more in the, in the view area, do more in the view model area because it's simpler and you know, it just, it's not that big of a deal. Like you can still write a view model that leaks through some of the kind of UI oriented aspect of it. That's not going to like be the end of the day, end of the world, end of the whole end of your life. Right? Like it's, it's fine. Um, however, talking about converters, like it would be nice if they were easier to actually use or if like we could do more of that in XAML, right? That's one of the things I love about the idea of like Razor and stuff is that you can do some of those types of like mutations in your view code and it's not really heavy, right? Like if I can, if I'm just like saying, oh, I have this string, you know, and I want to like, or maybe a better case is like I have some currency value or something, right? And I want to format it as such. I know we can do that with the built -in string stuff, but like, let's pretend you couldn't. That would be a nice case to be able to just like have a way to write a little bit of C sharp code that like did the thing that you wanted to do to that property from the view model, but you didn't have to use a converter. You didn't have to use another property on your view model. And like, that's something that doing a blazer, like the, the WASM stuff in my app, was really felt really freeing. It's like, oh, I can do that kind of stuff here. It's easy. So. Allan Ritchie (21:21.837) And you got away with it. It works. And that's really what it matters at the end of the day. It works. So as much as I say, don't do these things, right? It's only experience. I've worked with a lot of apps and I've seen these things go more wrong than right. That's generally where my experience goes. Jon (21:25.006) Got away with it. Jon (21:37.006) So you're in the camp of like to do something like that. No, I'd still rather do it in the view model so that like I can maybe test that the actual string coming out is correct or something like that. Allan Ritchie (21:47.405) Now I know how to avoid getting that data points mixed up, right? So when we're talking about converters, so one where converters tend to work, but I still don't need to use them as I convert other ways is something like a map, right? So when you put a pin on a map, it's obviously a collection of two doubles, right? And if you're probably gonna pass it, like if I'm putting a pin on it, for instance, I'm probably going to put some sort of piece of data on that like a description or an image, right? So I can define that in my view model as a record and say this is the four points of data that I want to create for a pin. That pin's not UI based. It's still data based. Jon (22:16.91) Yep. Yep. Allan Ritchie (22:30.125) Right. So I can ship it over and say, when I ship this over to my view model, I can have my code by and decide, Oh, right. Okay. You're telling me there's a new pin. It's going to go and put the pin on the map and it's going to do it in the UI. Right. So it's going to find the native, the name, named a reference to my Google map or whatever. And it's going to translate that type that the view model just kind of signaled. and then it's gonna put it on the map. But I didn't have a UI type leak across, right? I just kinda transferred it. Could I have done it with a converter? Yeah, probably, but definitely not as easy, right? Jon (22:58.126) Yeah. Yeah. Jon (23:06.574) Well, depending on what the source of data looks like too, right? Like where is that coming from, I guess? Like did you create a, yeah, you created a new, yeah, I just mean in terms of like what, like is the observable giving you a more complex data object, you know, like, so you're kind of reducing it down to a more simple data type in that sense. Yeah. Allan Ritchie (23:13.613) and observable. Allan Ritchie (23:22.764) Yes, I'm emitting it, so it's not really an NPC. Allan Ritchie (23:29.515) Exactly. And it's still unit testable because I don't need to emerge the UI types, which that's a big deal. Now all of that said, Jon (23:37.646) Well, and that's kind of, you know, if I'm gonna try and be unbiased here, like that is one potential advantage of type converters is they are unit testable. Allan Ritchie (23:50.412) Yes, yeah, you beat me to it. I was about to say you can unit test type converter. There's nothing wrong with doing it, but you again, you're again, you're at. You're kind of blurring the lines, right? I mean, these days, if you're going to go that far, you may as well go all the way in terms of like writing an automated test. Right, so the unit tests will get you some of your metrics on the view models so all the companies can check their box. Right, we got our unit test coverage that we wanted. Jon (24:18.798) Mm -hmm. Allan Ritchie (24:19.595) and now we're running the automated tests. So there's a bit of a line, right? I have always managed to get by with my two converters and avoiding other converters and extensions I never use. Never. Never have I used a XAML extension. Am I stupid? I don't know. Never. Jon (24:37.486) No, I mean, I, I, I, I looked at them. So one of the things like we talked about this quite a while ago now, actually, I think, um, just the idea of like, Hey, what are some things that would make, um, XAML nicer, right? Like in, in some of the, the same veins of these conversations of these points that we're talking about. Um, so markup extensions like that, that gives you, you know, a way to maybe. do some interesting things with it. And I had started kind of even looking at, is there a way I can use markup extensions to do something that's a little bit easier for doing some of like the conversion stuff, like type converter stuff. And I didn't get too far with it. I think I ran into some problems for the exact scenario that I wanted to do. But I mean, there's some maybe interesting ones out there. I'm struggling to think of like where I might use any of them today though. Allan Ritchie (25:33.961) Now, looking at C sharp markup, they're actually from what I've dealt with, there really isn't a need for type converters at all, because you can do a lot of that cool casting stuff and it just works, right? Like type converters are more to deal with the XAML lack of context, I guess, for the best. I mean, correct me if I'm wrong, but that's the way I've seen it is that that C sharp markup, you just don't need it. You don't need the type converters. It's just it's implicit. Jon (25:45.262) Mm -hmm. Jon (26:02.574) Yeah, exactly. Well, that's kind of that's what I'm saying. Kind of like with with doing like the razor stuff too, right? Like in the sense you're kind of just writing code in line where you need it to do something that you would maybe use a converter to do. Allan Ritchie (26:03.209) Right? Allan Ritchie (26:14.345) Right, and in blazer and HTML, everything's a string at the end of the day anyways, right? So it's more or less the same stuff, right? Now what's the other thing in terms of XAML stuff? Behaviors. That was the one I was looking for. Now, behaviors I have used. I haven't really had to port too many over because I find I can just do it in handlers easier now. Jon (26:19.758) Yeah. Yeah. Jon (26:30.638) Yeah. Okay. Jon (26:42.35) Okay. Allan Ritchie (26:43.273) for certain things like... Jon (26:45.614) So are you like mapping, like doing your own mapper stuff on existing handlers to kind of get at, you know, changing things on the native level? Like that's, is that what you were using? You know, you would maybe have used a behavior for. Allan Ritchie (26:58.889) Yeah, so something like focused was a big one. So there was like, you wanted to know when a text, like an entry. So I just did one of these recently and I'm pretty sure it was fully handler. You know, I'm old, I forget. Anyhow, what it was in the original, it was a behavior when the focused event fired, right? So I bound the behavior to the entry. Jon (27:03.534) Mm -hmm. Allan Ritchie (27:22.123) When the focus event was fired, I bound a property to say is focus true and vice versa for when it wasn't focused. So that's not because it's an event. It's not something that's easily bindable. You could do one of those event binding things, blah, blah, blah, blah. But for this part, the behavior was easy. It did the focus. It did exactly what it needed to. And that way I could do things like change the border color, right? Or I don't know, whatever you want to do, whatever you want to do because focus is achieved. Jon (27:26.382) Mm -hmm. Jon (27:47.406) Yeah, I'm looking at some of the behaviors that I have in my app too now just to kind of familiarize myself with them again. And I have a few, I don't have many, but like it is a nice way to kind of get at the native controls in a pretty simple manner. Like one of the things that with the handlers, like, yeah, it's much easier than renders were back in the day. Like you can basically update the... Allan Ritchie (27:51.882) Cough cough Jon (28:17.23) the mappers, the property mappers or whatever, and have your own thing run and you get access to the instance of like the platform control and then you can do your stuff there. I never remembered like offhand how to like do that pattern correctly. And so I'm, it is a little bit weird. And even though like I'm fine with making my own handlers completely for things like that, I'm like exposing controls that are like new things. Allan Ritchie (28:32.65) Yeah, it's a weird one too. It's - Jon (28:44.718) But yeah, when I go to like alter an existing one, I always kind of forget how to do it. And honestly, behaviors are the thing I like about them from a Maui perspective. So like with the behavior, you get the, the attack on attached to, um, method that you override, right? So that's like when your behavior is going to actually be attached to the control instance. And at that point you can, you can do a bunch of different things. Uh, and one of the things, basically whatever you want, but then like one of the other things that you do, Allan Ritchie (29:09.802) basically whatever you want at that point. Jon (29:14.35) offer I find myself doing often is when a just because like you're attached to the control doesn't mean things are all like set up and you're able to access it properly either depending on the platform, especially. And so I ended up like subscribing to the loaded event for the view. And then I, I know once that loaded event has fired and I unsubscribe to clean up after myself, cause you know, I'm good. Uh, after that's fired, then I know like things are set up and I can start, you know, altering. Allan Ritchie (29:38.57) All right. Jon (29:44.494) uh, that native control where sometimes you can't until that event has happened, especially, I think windows was particularly bad about that. If it, if the control wasn't loaded yet and you tried to like do something to it, it might just crack. Like you might get an exception, right? So. Allan Ritchie (29:59.658) Windows. Jon (30:01.294) Yeah, so I have a few. I do ones like on Android. So on my pool app, I've totally created my own Frankenstein control, right? And so I do things like remove the outline from the controls on all the platforms because I kind of draw my own Chrome around it. And... Allan Ritchie (30:21.61) That's what everybody does though. That's fair. That's fair. Jon (30:23.854) Yeah, yeah, I mean, yeah, they're in obviously it not being consistent and how that looks across platforms to start is usually a catalyst for wanting to do that. In my case, it's, it's, you know, that plus some other stuff too. So I ended up doing stuff like that. You're going to like this one. I have one that, that I call the round the corners behavior. And it's literally named that cause I don't know why not. And, um, Allan Ritchie (30:42.09) Oh boy. Allan Ritchie (30:50.378) It's just a border, right? Jon (30:51.95) Well, it's not, it's letting me compress the control hierarchy so they don't have to put a border around a thing. So if I have a grid, I don't want to put a border around it because that's two control instances I have to deal with now. So I... Allan Ritchie (31:09.066) John didn't pass my metric. The first question I always ask is, do you have a performance problem? Well, you're so, oh, you did not on a control. Did you really, or was it like, was it like 30 nanoseconds and you were like, this has to be optimized. Jon (31:15.246) I did though, I did, okay? I did, yeah. I have like, I have, okay, there's two parts to this. I did in earlier Maui days when performance wasn't as great, like in the net six days bleeding into the early net seven days, like. There were times on Android, especially where like loading a page that had a whole bunch of controls on it took a long time, like not acceptable. Like. Allan Ritchie (31:49.29) How many controls are we talking about? Just eyeball it, just eyeball it. Jon (31:52.046) Oh, yeah, I'm opening the app and I want to see. It's got to be like 30 different controls at least. Allan Ritchie (32:03.338) and you were having a problem. Jon (32:05.006) In early days, that's what I'm saying. We've obviously made things better because it's not that bad anymore, but it used to be not great for some of those things. I can't even find my app anymore. There it is. Yeah, like in the pool settings page, I've got one, two, three, four, five, six, seven, eight, nine, 10, 11, 15, 18, 20, yeah, probably about 30 different entry fields. And this isn't just like... I'm not counting like every image or anything. Like there's those as well on many of those. So like there's like 30 entries in text or check boxes and stuff like that. So it's, it was a lot anyway, anyway. Allan Ritchie (32:37.514) Okay. Okay. Allan Ritchie (32:44.778) Alright, alright. I mean, I've seen a lot more controls on a page without a problem. In Maui! In Maui! Okay. Jon (32:49.582) I know, but it was, it was slow. It was slow. Uh, it's probably if I did it again today, I wouldn't feel the same way. But now that I'm like, you know, have that optimization and it works for me and I like it, I'm going to keep it. So yeah, I can basically assign this behavior to like a grid or, you know, a vertical stack layout or whatever. And it alters the, the platform specific control to put like a nice border around it with a corner radius and a background color and clips it and all that. It's very nice. Allan Ritchie (33:19.562) All right. I'm just nodding at John right now in agreeance. Not really agreeing, but whatever works. He works. He knows it. He knows it, but that's all right. It's all right. It still works. It still works again at the end of the day. If it works, that's great. Would I do that in a traditional app right now? If you had an app for a customer where the app is a hundred plus screens, probably not. Probably not. Jon (33:25.326) Yeah, yeah, it's one of those like, mm -hmm, okay, sure. Yep, you're good. You do you. Works great. Jon (33:48.846) Yeah. Allan Ritchie (33:50.282) Probably got bigger fish to fry, but that's all right. It works for John and pool math is working well. So there you go. But do you have unit test, John? Do you what? No. I know you have DI in that thing because you bought into that a while ago. Okay, which is good. Jon (33:56.078) That's right. That's right. I do. Yeah. So. Yeah, I have, so to be fair, okay, so my unit tests are largely around the actual calculations in math for like the pool chemistry stuff. So like that, maybe you don't even count, cause that's more of the, like I'm testing, you know, given the inputs, does the output match like the calculation I want? Allan Ritchie (34:30.346) That's probably a pretty darn good thing to be unit testing because that's the core of your app, right? Jon (34:33.902) Oh yeah, yeah, yeah, exactly. Like I don't want to screw that up, right? So don't want to mess that up. So that's, that's a lot of them. I don't have a lot of like unit testing, like the view models and the patterns around them, but I do have some UI tests as well. Um, those are old, but I've, I've kind of kept them working. They're all Appium based now. And mostly I have them because I want to have an easy way to take all the screenshots when I update the app so that I can update the store listings. But it's on my list to add some actual more, now that I've done the work to have a proper encapsulation, I guess maybe you want to call it, of my logic, it's all unit testable now, like my view models and my navigation service could be not mocked out. I can do all that, I just haven't done it yet. Allan Ritchie (35:04.202) Great. That's still a good thing. Allan Ritchie (35:28.714) Now here's a good question, because you're doing a lot in Blazor, right? You got some UI in Blazor. So obviously now the more XAML you have, the harder it is to bring over to Blazor. Would that be a fairer? So again, I don't mind XAML at all. I like XAML. It is verbose. I don't want carpal tunnel. So I do what I need to do in XAML. I get in, I get out. I love grids. I love the way it lays out. Jon (35:32.269) Mm -hmm. Allan Ritchie (35:57.738) What I don't love, like I said, is the converters, the extensions, you know, all that stuff. But if in a world as we look forward 10 years down the line, and this is just my two cents, John's not going to put his stamp of approval on it. God knows nobody at Microsoft will, but I don't see XAML. I see a world where unfortunately web wins, which sucks because there's too many divs. There's already enough divs. And I do like XAML. I do like C sharp markup. Jon (36:02.702) Mm -hmm. Allan Ritchie (36:26.214) But I think web just wins at some point. So the more XAML heavy you are, the harder it will get to Blazor. And maybe that's a case you never have to worry about. But as I look at customers, some of the hard screens, especially around stuff like collection view, you know, some people go so crazy that some of those things, and I think I've talked about like the response of grid layouts that I've had to do, like where the columns are different sizes, like it's not just an equal grid point. You're going to do those. I've done those in Blazor and been quite successful, right? Jon (36:39.95) Yeah. Allan Ritchie (36:56.165) But the more XAML heavy it's been, obviously the harder it is to bring over, the harder it is to do because you've got all that logic tied up. Whereas if it was just in the view model, right, it was very easy to just say, use this data, here's the layouts, go do your thing. Because CSS does like responsiveness fantastically. Jon (37:15.342) Yeah, I mean, my experience was really not that it was challenging from the view model perspective to do what I needed to do. It was like, I really just took like, okay, I have this XAML page. It's going to be a razor component. I have this, I do like, well, here's another thing for XAML. Like, I don't know how much you make use of like, you know, user controls, I guess, if you want to call them that, right? Like a... a XAML content control based on whatever. So I tend to divide stuff up like that. Like for my apps home screen, it's basically showing an overview of like what your chemical levels are at. So it's kind of like the five or six, depending on how your pool's configured, different cards that show like for your free chlorine levels, like what's the last date you did a test on, what's the current level at. Uh, do I want to show like an indicator that says like, Hey, this needs attention cause it's not looking good. Um, so like that card is like, I put that into a control, right? So that becomes a razor component as well. So it was pretty simple in that sense. It really was just like, how do I make this XAML appear in HTML? The actual like getting the data connected. I mean, my view model is just plugged right in for the most part. And it was pretty simple. Allan Ritchie (38:41.381) Well, and if we go back a second and we talk about XAML with custom controls, think about how much stuff has to go into those binding points, right? So just like a, like a, if I have, let's say a label and an entry, right? So I put them together as like a form field, right? So it's cause you can't really have an entry without saying what it is. Could do placeholders, whatever, but let's just say we have a label and entry. So now I'm obviously not going to open up all the bindable points on the label. Jon (38:48.398) Mm -hmm. Jon (38:53.55) Yeah. Allan Ritchie (39:08.549) and I'm not gonna open up all the bindable points on the entry and there's gonna be overlap there. So how do you deal with that, right? You don't, you really open up what you need, but that's still a lot, right? Yeah. Jon (39:18.926) Yeah, and it's a lot of C sharp code even, right? Like to create the bindable properties and to wire it all up. Yeah. And I think in that sense, like moving over to a razor components for that same thing was quite a bit easier because it wasn't, it's a parameter, right? Like it's so much less ceremony to build the thing. Allan Ritchie (39:37.922) Exactly. And now I know there's stuff like source generators out there now that help with like the statics. I don't have you use them. I don't personally use them. I usually just do that stuff. I've got like some snippets and I go bang, bang, bang, type in my stuff. It just, it works. It's not ideal. Um, but it works. But again, still that that's the raw stuff. That's what I'm talking about. It's all that XAML verbosity and, and, and typing. That's where I tend to worry. Jon (39:45.006) No. Jon (40:04.078) Mm -hmm. Allan Ritchie (40:07.521) About those things and I've seen companies put so much into that and it's great But again, if you focus on the controls, you're pretty good. You focus on handlers. You can get rid of stuff like behaviors and all that stuff But don't get wild with those converters or extensions. I'm telling you I have not seen good I want to be proven wrong John yours doesn't count because you're the only owner you don't have a team to work with so it's not fair it's when it's a team and Then you can create duplicates Jon (40:30.158) Yeah. And I feel like the markup extension stuff though, like that's not, I mean, I'm sure there are people that are making their own and using it that way, but I think like that was more a thing for like almost the actual Maui implementation too, right? It's, cause we have like markup extensions that unless, you know, if I'm, maybe I'm not understanding the breadth of what you mean by extensions either, but there's things like, yeah, so there's things like, Allan Ritchie (40:57.409) Markup extensions. Yeah. Jon (41:00.622) I use now in XAML the like stroke shape has a markup extension where you can specify a nice little tidy string that mentions both the shape that you want to use. And if it's a rounded rectangle, you can also put the corner radius in it too, right? All in like. Allan Ritchie (41:20.289) So it's like the fast way of doing like a grid row definitions and stuff. Okay. Jon (41:24.718) Yeah, exactly. Yeah. Which is that. That's the same idea thing too, right? So like they're handy for that. And there might be more markup extensiony things that we could put into Maui itself or maybe a community toolkit, add some that do kind of neat things there too. But like, yeah, I don't think that's something I would generally build for my own use that much. I'd have to have a really compelling case. Yeah. Allan Ritchie (41:28.865) So you're saving me carpal tunnel syndrome. Allan Ritchie (41:45.313) Okay, see education, education. That's what I'm looking for is what the heck do you use these things? Please don't use them for localization. But anything else? Yeah, that's the one I've seen. Jon (41:53.678) Oh, I was just going to say like that was, that was maybe a case that I looked at, but I didn't end up doing that because I didn't, I wanted the strongly type stuff. Right. So. Allan Ritchie (42:02.018) Yep. And that's all I'm saying is that the places where I've seen them used, I haven't seen them used appropriately in my opinion, my opinion. But there's also stuff like, I think we use this as one of our nougats of the week one time was compiled bindings and compiled bindings is essentially, everything's a markup extension when you look at it, right? Even the binding is essentially a markup extension, but X bind was the one that Jon (42:04.494) Mm -hmm. Jon (42:11.694) Yeah. Jon (42:18.734) Yeah, I was just gonna say, you're probably gonna say the same thing. Jon (42:25.486) Mm -hmm. Allan Ritchie (42:31.713) Now, I don't know why I don't use it more. Do you use it extensively? Not yet. Jon (42:36.622) I had it in my app and then I just kind of like started trying to look at it and got sidetracked with something and I just never got back to it. Yeah. Cause like in theory, this is the thing that maybe would be, it would be good for me to go and revisit my converters and see like that could be, you know, using this compiled bindings, X bind stuff instead of a converter. Cause a lot of my stuff is like super simple, right? Allan Ritchie (42:44.225) forgot about it. Because X -Bind... Allan Ritchie (43:02.561) Well, and it's great for those cases where, so if you've got like a multi binding, right? So you can go not this off the data type, but is equal to this. Like you could do those and you could do like a straight exclamation, not, and you could do an and or an or right there, right? It, which is, is, it's quite powerful. I don't know how fast it is. I mean, it's called compiled bindings, but is it really compiled or is it evaluated? Jon (43:12.718) Mm -hmm. Jon (43:23.182) Yeah, I was gonna say, like, I think the claim is that it is all compiled. I don't know in practice, you know, what it looks like, but it's certainly interesting. Yeah, exactly. Allan Ritchie (43:31.969) I haven't looked, but it does look interesting. And I know, like I said, C sharp markup gets around that because they don't need to do any of that. Like it's just kind of comes natively out of the box. Now another project where I've seen kind of those bindings and this goes outside of XAML. But if we look back, I like bringing up MVVM cross because I think like the .NET mobile world learned so much from that and all the experiments that Stuart did there was. Jon (43:41.838) Right. Jon (43:53.006) Mm -hmm. Yeah. Yeah. I think a lot of like Xamarin forms, you know, took some, some informing from that work too, right? Like, Allan Ritchie (44:05.793) Right. So he had some, the bindings for against like the Android markup and the IOS, well, IOS was a bit different, but it was, it was very powerful. Like he had like the X bind stuff back in those days, right? Which wasn't like pure, like pure XAML WPS style did, didn't exist yet. This was before Xamarin forms and it was beautiful. The binding just worked. I think he had a, Jon (44:11.918) Yeah. Jon (44:19.566) Mm -hmm. Allan Ritchie (44:32.897) cool nickname for it because that seemed to be something that he did. Right? And it had all those powerful things. How fast it was comparatively, I guess I never saw an issue, but it worked. Jon (44:35.566) Yeah. Jon (44:43.342) I mean, I know companies use it. I know, like I said, I think before too, like Greg shackles, like they, when they were using Xamarin for their, their app and Olo there, they were MVVM cross at least for the first several years. Um, and it, it, it fit really nicely with Android. Like when you were doing the Android layouts in XML, right? The AXML. Yeah. Like it's, it, you're right. It's kind of like. Allan Ritchie (45:09.153) Yeah, the binding syntax was right there. Jon (45:13.55) reminiscent or maybe, uh, maybe XAML is reminiscent of what they did there. Like you're saying, but it fit very nicely. I liked it. Allan Ritchie (45:21.345) It was obviously XAML came probably first, but just some of the stuff. And I know MVVM Cross ended up going more to the expression based binding. So like the C sharp markup style. I mean, obviously that's the preference, but now with stuff like data types and kind of the compiled XAML, you don't really notice that the same. So that's maybe it's a case to look at X bind or this compiled bindings again, because. Jon (45:26.222) I mean, yeah, like Windows XAML, I'm sure, WPF or whatever. Jon (45:33.422) Mm -hmm. Jon (45:47.054) Yeah, yeah. Allan Ritchie (45:49.601) We can't make it our plugin of the week twice in a row, but it's something I'd love to try again to see the performance on it. Jon (45:52.206) No. Yeah, I mean, you're making me want to like go in and spend an hour and just like see how many converters I can rip out and use X bind instead. So maybe I'll have to do that. The other thing to that, like talking about compiled bindings that not everybody necessarily always knows, right? Like this is, this is shamefully something I didn't do in my own app until I migrated it to Maui, which was to actually declare the data type that you're using, right? Because it's like right there is a Allan Ritchie (46:04.289) Oh, there we go. I've started John on a mission. Jon (46:23.886) almost free instant performance boost, right? If you're able to articulate the data type in your XAML so that the XAML compiler knows, hey, I know what this is. I can actually like emit better code that's not going to be invoked dynamically at runtime to the same extent and then do the thing. And IntelliSense. Yep. Yeah. Allan Ritchie (46:41.729) and it warns you now. IntelliSense, but it warns you now too when you haven't done that. It's like this is now interpreted. Enjoy. Jon (46:49.902) Yeah, well, and this is one of the actually the funny we're talking about it. This is an issue that just kind of came up to her or not that just came up, but I was talking to Stephon and my team, who's the kind of the, the, you know, the XAML guy. Yeah. Um, where if now with Maui, because like, we're not running XAML compiler XAML C at debug time, right? We, we do kind of like a different version that's trying to help identify issues. But, uh, if you, Allan Ritchie (47:01.889) He is the XAML guy. Jon (47:19.278) debug your app, it's doing everything dynamically, like all full dynamic bindings, there's nothing compiled in debug mode. And so what happens sometimes is if you specify a data type, but then at runtime you're like giving it not an instance of that type, in debug mode, it's gonna like try and reflect over the properties and it might just work fine because the property name that you bound to exists on the type that you. gave it even though it's not the data type that you told it was going to be. Cause it, I mean, truthfully at debug, it doesn't, we don't care about what you say the data type is basically. But if you start then building your app in release mode, um, basically it's just going to not like work sometimes, right? It's, it's going to say, Oh, and I think what's happened is it thinks of it as basically doing like a binding context as you know, the declared data type that you gave it. And if that fails, you know, you've got like a null instance essentially that you can't get the property value out of. So you might have a label that in debug mode has text, but because you declared the wrong, well, you declared a data type that's different from the one you gave it at runtime. Suddenly your label has no text when you build for release mode and it's not, well, it's, it's complicated. Yeah. Allan Ritchie (48:35.169) It should implode, no? Maybe should? One of those hard, harder... You can always tell when John's about to say that. Yes, no. Jon (48:45.518) Yeah. Yeah. So we're going to try and do something to make that a better experience in terms of like discovering those cases, but it's not as simple as you might hope it is, which is just the story of life. Allan Ritchie (49:00.193) Now, the last thing I wanted to bring up, so this isn't in our notes, I love to just bring these things, but I know this is truthful, is the great Jonathan Peppers, I'm pretty sure I can quote him on this. He's like the performance guy, right? He's the Maui performance guy, he's the guy that goes in and digs, he'll dig the deepest, he'll dig as deep as he has to, right? Jon (49:12.59) sure. Jon (49:19.758) speed scope files and... Allan Ritchie (49:24.961) So I know he has mentioned and I know a lot of us know this from the past, right? Like converters obviously imply a lot of extra overhead, right? So when you're using them simple in forums and like one offs, it's not a big problem. When you use them in a collection view where performance is already a bit of a fight, they get really bad because now we're working with, you know, sometimes a lot of converters and... Jon (49:43.406) Mm -hmm. Allan Ritchie (49:53.953) they will slow down the binding of those items a lot, right? Because everything's, especially ones with like data templates where it's flipping around the types. I've seen it, right? You take the converters out and it's almost an immediate improvement visually, let alone like right down to a timed level. So I know I read recently, John Peppers came out and said, yeah, if you're using converters in a collection view, you're gonna have problems. I mean, that's as far as he needed to go. But it's true. I've seen it, right? We took some... Jon (50:24.366) Should I tell you that I use converters in my collection view templates in my app still? Allan Ritchie (50:30.241) Hey, well, I'm just the bearer of the news. Don't kill the messenger. And it's... Jon (50:32.974) Yeah, no, I minimized them, but I still use some of them. And then, again, it got to the point where I'm like, yeah, this is working fine. I don't actually need to dig farther. But if I did, I'd probably go after them. Allan Ritchie (50:46.241) But again, you don't have a problem, so why engineer a solution for a problem you don't have? But in some of these apps I've seen, yeah, exactly. And there's customers I work with that want to optimize everything, and you're like, dude, that last 2%, so to get that last 2 % of details is going to cost you, you know, like, Jon (50:49.261) Yep, so it's that first rule of optimization. Jon (51:00.622) Yeah, you really want to pay for that last 2 %? Allan Ritchie (51:07.553) 80 hours, why? Don't dig. Wait until customers say this is a problem, then dig, right? Because now you have value, like a cost associated with the value, right? But some of them want to, whatever. This is a case where you didn't have to, converters are working fine in your collection view. Are you using your virtual list view though? Yeah, you already did. Jon (51:08.622) Mm -hmm. Mm -hmm. Jon (51:19.374) Right. Jon (51:28.27) I am, although I did, I did a branch recently cause like we've got kind of a, uh, you know, current effort of looking at collection view performance, just kind of across the board all up because you know, we know it's an area that people are still wanting, uh, a better experience around and there's still issues and, and some, there are some legitimate, you know, concerns around performance and things that we can do to fix them. Um, so I did switch back to collection view on a branch just to see like, yeah, where are we at today? Cause. For my app, one of the use cases was I have a data template selector and then I have probably five different data templates that could be selected. And they're not like, there's not really a consistent pattern, right? It's like, whenever you add a log, if you're adding like an expense log or a chemical test log or an addition log or a note log or whatever other logs I have, it's however you add them in your app, right? So there's no like, pattern to the order that these things show up. And back in the day in forms and still into early days in Maui and till I think net eight, it was all fixed. Um, our data template selector code for collection view, like on both Android and iOS basically was like for any kind of data template, like it only, it only kept track of one type of data template and it would, as it's recycling templates, it's like, Oh, this isn't the type of data template that the selector wants. I'm still going to use this, but I'm going to get rid of the thing that was in there and put the new thing in. And so like it kept churning over and over every time like a new template was needed. It had to like rebuild on a recycled cell. Right. Um, and so I did a PR a while back that basically was like, no, no, no, like let's track, you know, the, the recycled cells. per type that we get back from the data template selector. So we have a pool of each type that you're using, right? Instead of like getting one from the pool and being like, no, that's the wrong one. I need to make a new one over and over again, like keep track of that. So it has gotten a lot better. Allan Ritchie (53:40.311) Well, and here's the thing, if we're looking at that and we're putting in converters, converters are very eval based. Are they not? Right? They're not really, there's not really much you can do. Right. Jon (53:47.566) Mm -hmm. I mean, there's, there's going to be reflection cause it's all like to an extent, right? Cause I mean, it's all like objects coming in. So there's casts and stuff and it maybe isn't that horrible, but. Allan Ritchie (54:02.038) it from what I've seen is that they're all eval based because they have to be right like it's it has to reflect them out it has to do the thing but that that's that's all a cost so reflections usually cheap one -offs a couple times in a form not a big deal those collection views like I said some of these customers are using a lot of these these converters right now even in an item there's one performance case I'm tackling right now now their main problem is they've got stack layouts out the wazoo like it's too many stack layouts Jon (54:17.582) Yeah. Jon (54:21.87) Mm -hmm. Jon (54:30.158) Well, that's another point maybe to talk about as well, right? Allan Ritchie (54:33.781) Well and a lot of people, okay so that's a great one in terms of XAML. A lot of people want to use stacks because they're very easy right stack here stack there but the problem that happens there is more measurements right so it has to measure the innermost guy to get the measurements to the outermost guy right and it's like a bubbling effect. Jon (54:38.286) Mm -hmm. You just keep nesting stacks all over. Jon (54:46.99) Mm -hmm. Jon (54:51.406) And I think I could be wrong at this point, because I mean, I don't get to touch code as much as I used to back in the day at this point in life. But I think we might still end up instantiating like a platform view for most layouts. I don't know if we've compressed that down or not. So I might be wrong. We might have optimized that away finally. But I suspect not. And so. Allan Ritchie (55:17.044) It is. Jon (55:17.422) Every time you add another level of these, these layouts, like you're at, you're, you're getting another platform, native control backing it. I think, I think that's where we are still. Allan Ritchie (55:27.829) Right. And so these, these, these layouts, these stack layouts, especially within a grid, again, the people do them because I mean, you could, you're old enough to have done tables in HTML, right? Tables were great. They were, they're hated now. Nobody used to, you do a TD and you're, and what do you do now? These divs, everybody uses a div now. Well, how the hell do I use that? But anyhow, it was, it was a big thing. Jon (55:32.622) Mm -hmm. Jon (55:39.182) Yeah. Oh yeah. I know, I still write HTML, I'm like, how do I do tables now? Everyone's using these things. Yeah. Allan Ritchie (55:54.708) to use tables and it was very comfortable right because you knew exactly how it was going to lay out in a grid. Now for some reason because XAML is so easy to do these layouts right so you can be like I want these two things grouped together right so going back to our form item right so I might do listen I'm going to put that in a horizontal so there's the label there's my entry it's horizontal I can set the buff the padding etc done next. next element, right? And then all those horizontal layouts go in one big vertical layout. So it's easy, it's comfortable, it's a natural look, but what it's not is performant. So I've switched this, this one particular view. It's a big, big, big view into a grid layout. Now you have to do stuff like remembering which row you're in, which column you want it in, where you've got the spans. Like it can be a lot. It's not, it's not natural. Like a table was. Right? Because you have to remember it's not hard, but it does. You have to do your mental math of okay, what row and what column I'm in. Whereas with table rows and table data, you knew where you were, right? Relatively. So people tend to go with the stack layouts and they're shooting themselves in the foot the same time they're doing it because it's comfortable. It's a comfortable way of doing it in XAML, right? It's essentially doing table data's with table rows. So what's doing it? So. Jon (56:51.182) Mm -hmm. But it's not hard. It's not hard. You just have to think a bit. Yeah. Jon (57:17.358) Yeah. Yeah. Allan Ritchie (57:19.954) Don't do that. Don't do that. Jon (57:20.43) So don't, don't do that and don't, yeah. And don't nest a whole stack of them and think that, you know, you're going to get good performance on a list that's scrolling, right? Like, yeah. Allan Ritchie (57:27.827) This collection view couldn't size itself properly. It's slow when it starts scrolling like really slow. Jon (57:34.318) Well, this is another thing, right? So like the, um, talking about, uh, vertical stack layouts and scroll views and collection views, like people tend to nest weird combos of controls that all want to kind of compete for infinite space in one of the dimensions. Right? So like having a, a vertical stack layout, you know, usually is okay. And like, uh, uh, uh, data template, you know, sell if it's like the outer. Yeah. Allan Ritchie (57:50.994) Yep. Allan Ritchie (58:01.555) One off. Ehh, go one off. Jon (58:04.174) It's fine. But then, you know, we'll see people do stuff like put a collection view inside a scroll view and like they're both vertical oriented to, and they're like, why is this not working well? Cause the, you know, they, they both want to take up infinite space and you're, it's not sure how to handle that kind of stuff. So be smart about how you nest stuff like that too. Allan Ritchie (58:10.162) Hehehehe Allan Ritchie (58:22.452) Well, and that's the again, this is again where XAML is powerful and also pain is if we look at something like so that scenario you just talked about, it's usually people that have like a dashboard. They want to show like the top five items for this, the top five items for that. And they're like, well, a collection view, that's how you do a list. Well, no, it's actually not. It's a bindable stack. Jon (58:33.998) Mm -hmm. Jon (58:42.51) That's pretty heavy if your list is, yeah, exactly. Allan Ritchie (58:45.268) It's a bindable stack layout or a bindable grid and you could just render and that's going to render the size. Like it's not going to virtualize it obviously. It's just going to, this is what you get. Jon (58:47.342) Yep. Yeah, if you don't have a list. Jon (58:54.798) Right, right. But with, with trying to virtualize, you know, there's weight that you incur trying to do that. So yeah, if you don't have like a lot of items to scroll through, just, yeah, just use the bindable stack layout. Allan Ritchie (59:09.396) And then that way you can have one scroll view. It's not gonna be virtualized, but you know, limit the types. And I've got some of those that work. Yeah, they work fine. Jon (59:11.726) Yeah. Yep. And you can get away with, you can get away with quite a few controls in that scenario with it being still very performant, right? Like it's not, yeah, yeah, well, yeah, I know, I know, I know. Hey, I'm just saying you wouldn't have been able to do that back in the day either. So. Allan Ritchie (59:22.996) More than 30. More than 30. I had to make the dad joke somewhere. Now this is the thing right so a lot of these troubles are because of XAML and because of the comfort of XAML so that's why we like to point out like these are the things that I'm not saying I'm right I'm not saying I'm wrong I'm just saying in experience these are the things that people do in XAML that tend to hurt and cause pain. I realize it's a comfortable way of doing it and it looks like the right way to doing it but it Jon (59:47.054) Mm -hmm. Allan Ritchie (59:56.179) Probably or might not be always check the other the other side, but I mean for all that's holy Please do localization interview model that one. I'll die on is that fair I can die on that hill I'll die on that hill Jon (01:00:00.91) Yep, you know exactly. Jon (01:00:07.566) I think so. Yeah, I think mine I mostly like that so I'll agree to it until I go outside of that box Allan Ritchie (01:00:13.267) All right, somebody can, you know, set fire to a comment or something. Comment on this. Jon (01:00:18.798) Oh, the, the other thing, you know, looking through some of my code too, if we're talking still optimizations, like if you've got kind of like a abstracted out, you know, user control, um, people tend to think that like you do the new item template and it's like a content view, right? Which is okay. But if you don't really need that to be a con, like if you've got that and then you right underneath that, you put a grid in there, make, make the top level thing, the grid, right? Like stop nesting stuff within itself. Like that user control. file can be. And I did this, I did an audit of this, cause I have a fair bit of like user control kind of abstraction of things. And I found, you know, an all micro to him like, Oh, I have like a lot of this redundant, like extra lay extra controls and stuff that are nesting just because I was too lazy to go change the item template from a content view to, you know, a grid. And it's not hard to do. You change it in a couple of places and then your grid is the direct thing. Right. And then you just saved yourself one more. layer of controls. So like there's lots of really easy ways to kind of optimize the XAML. But again, it's kind of like that's that's XAML making it kind of easy to do it the wrong way. Allan Ritchie (01:01:28.626) One of the things I also tend to see, since we're on that content view, is people use it, and I'm guilty of this too, right? As using it as like an empty view holder, right? So it's like, let's say you've got, if you're in this mode, you show this content view, otherwise show this content view. They'll use that, because it doesn't have any background. It's basically an empty holder, placeholder. Jon (01:01:45.934) Yeah. Allan Ritchie (01:01:55.185) Right? So they'll do content view, content view, and you'll probably do that in a stack layout. That's common. It's understandable, but that's again, understand kind of what you're doing there. That's another problem with XAML though, is that you need to have that placeholder in a layout. You can't have placeholders and then say, put it in this layout. Right? You can't really, you can't really do that. Jon (01:02:05.422) Yeah. Yeah. Jon (01:02:14.638) Yeah. No, I mean, yeah. The only way like I have cases of that too, where I've got like the, like for my, my list, I have like a template and every item has a few of the same things in the same spot. And then I have kind of a content placeholder, which is a content view, but like the, I don't know the outer view of the, the kind of what goes in there for each thing always. So I haven't found a good way to kind of not nest that extra. more than it needs to be at. So sometimes you kind of have to. Maybe there's a way. Allan Ritchie (01:02:48.337) Maybe. Educate us. Educate us. Somebody that knows this. Again, I've gotten by pretty good. I'd like to say my success ratio is pretty high. But I don't often tend to have to go too far outside of the box for XAML. I am doing a lot of C sharp markup these days. Jon (01:03:08.11) Yeah, are you switching to that a little bit? Allan Ritchie (01:03:10.193) A lot of it I am doing a lot more blazer stuff for some of the apps I'm working on right now just because the views like I said that responsive layout it's just web is easy to do it in. I don't know that there's any layout natively like Swift UI I tried to do it in Swift UI with like a dynamic grid based thing like Pinterest that's what I'm kind of talking about that's a complicated view. I have not seen anything out of the box to do that. Jon (01:03:32.75) Yeah, oh yeah, that's a hard one. Jon (01:03:39.022) I mean, the UI collection view, like the compositional layout stuff is probably what may be the best attempt at making that achievable, more generically speaking that I've seen, but it's still not easy. Like you still have to think about it. Allan Ritchie (01:03:39.792) anywhere. Allan Ritchie (01:03:54.799) Yeah, so I didn't have success. I'm not a master UI specialist. I basically, I need a designer to make something pretty. And then I go and go, that's a grid. Great. Jon (01:04:03.438) Yeah, that, that, yeah, exactly. Like that, that's the case where I run into him. Like I know we're going to make some different, you know, design choices here, cause this is not going to be easy to implement. Allan Ritchie (01:04:10.033) So that one, like I said, it's easy. I can go to like a bootstrap or any of those, those HTML frameworks where this is common because it's a desktop pattern, right? And those responsive kind of, and it was just easier. It just was, there was no, and that's fine. Pick what works for you. Was it as performant? I don't know. I mean, I didn't, I did not, not like the experience. It was not XAML. Jon (01:04:23.15) Yeah. Jon (01:04:26.67) Yeah. Yeah. Jon (01:04:36.91) Yeah. Well, and it was, it was not XAML and there's, there are other, you know, things out there that, that help with some of these areas too, right? Like what's, uh, what's your, your pick for the week for the plugins and packages and products. Allan Ritchie (01:04:50.416) My package of the week is a plugin, sorry, I don't want to call it a plugin. It's not a plugin, it's a control library. It's the SharpNado Collection View. It is an absolutely beautiful piece of work by Jean -Marie Alfonsi. I hope I'm pronouncing your name right. Jon (01:04:59.886) Mm -hmm. Jon (01:05:06.99) Speaking of saying, you know, whatever using the wrong French. Allan Ritchie (01:05:09.968) Yes, if I'm, well, it sounds French name, but I don't know. If we're wrong, yeah, if we're wrong, we apologize. Feel free to slap us. I think he's a good comedian anyways. If you've ever seen his tweets, he's hilarious. So feel free to slap us. If we said your name wrong, I'm fine with it. Yeah, it's fantastic. That thing. So I just did a grid with it recently. Very performant. So John's does the list view very performant. His does the grid, the bindable grid, very performant. Jon (01:05:13.07) I'm assuming. Maybe I'm wrong. Sorry if I'm wrong. Jon (01:05:17.998) Mm -hmm. Jon (01:05:21.454) Yeah. No, love the sharp NATO work always. Jon (01:05:36.59) Mm -hmm. Allan Ritchie (01:05:38.) It has some wonderful infinite paging stuff in it too that works fantastic. By the way, I have Pierre coming for you for grid spans, but sorry, not you, John. It's SharpNado. Jon (01:05:48.014) And there's, you know, I mean, no, no, no, the sharp, the sharp, the collection view stuff is great, but like there's, there's some other sharp NATO stuff out there too. That's, that's equally cool. Right. Like different libraries to tabs and yeah. Yeah. That's got like a task loader thing, right? Like the kind of skeleton UI or like lazy loading stuff. Yeah. Yep. Allan Ritchie (01:05:57.999) Yeah, it gets my stamp of approval. He's got tabs. He's got some card view. Allan Ritchie (01:06:07.055) Yeah, a bunch of great ones. But the Collection View is my pick this week. It was fantastic. It performs well. It does bindable grids. Very nice. Chef's kiss. Chef's kiss to that one. Jon (01:06:18.254) I don't know if it's got Windows support yet though. Allan Ritchie (01:06:21.967) Oh, well. I won't even get started on that. Don't... See, you poke the bear on purpose. You know I'm gonna say something nasty about Windows, but I won't. He's trying. He's just trying to instigate, but you gave me a rule saying, just be nice. I'm being nice. No. No. No. I will die on that hill. Okay. Okay. Just... Just... Just... Jon (01:06:24.302) You Jon (01:06:28.462) Yeah, I try. I try. Jon (01:06:34.19) Windows is easier now. There's more APIs that we can use now for that kind of stuff. No, just for the collection view part of it. That's all I'm saying. Like building the virtual list view, the hardest platform has been iOS, hands down. Allan Ritchie (01:06:50.191) Okay, you're still antagonizing. Just Windows is not, it's not a fun territory to play in. I'm happy to be told otherwise. It's still, I'm gonna be the rock. The immovable object on this one. Web, iOS, Android, and even Android I hate sometimes. iOS is just perfection. It's just perfection. Mostly. Jon (01:07:07.31) Yeah, yeah. Jon (01:07:12.43) All right. Well, go, uh, you know, maybe go, go write some XAML, go check out the compiled bindings in your apps. Let me know how it goes, Alan, so that I can decide if I want to try and do that activity. Allan Ritchie (01:07:19.951) Yeah. Allan Ritchie (01:07:24.111) be the I'll be the bikini pig that's fine. Jon (01:07:26.99) Great, yeah. And yeah, everyone else out there too. If you want to check those things out, we'll put some links in the show notes. The other thing that's worth checking out, I don't know if you know about this, is leaving a review on Apple podcasts. That's worth checking out. Allan Ritchie (01:07:40.685) No? Allan Ritchie (01:07:45.23) Oh. Yeah, I don't personally do that because. Well, I don't listen to myself. You usually tell me if I'm too quiet or too too loud. Jon (01:07:53.806) Didn't I tell you to go leave a review? Come on. I probably haven't left a review. I'm going to go leave a review today. So. Allan Ritchie (01:07:59.917) Oh, is it gonna mock me? Jon (01:08:02.094) No, it's going to be a five star, like, you know, just really propping things up, getting all the, the reviews. Oh, the other thing that, that we haven't talked about, I don't know if this one will be yet. Um, we're going to start trying to push some of these to YouTube. So I've been trying to keep my background more cleaned up. I don't know if you've put any effort into yours. Allan Ritchie (01:08:06.925) All right. Allan Ritchie (01:08:20.782) No, but I can. I have my nice toy collection, my lightsabers, my Lego collections. Jon (01:08:22.318) Well, maybe you should start. Yeah. I've just been like removing the junk the kids leave there so that at least that's not there. That's all I mean by effort. I haven't really done more than that. Allan Ritchie (01:08:34.414) I'll put some effort. I'll put some effort so you can see my face. Jon (01:08:37.358) So yeah, maybe be checking us out on YouTube soon as well, where you could, when we get all the things set up, I don't even know all the stuff I need to ask for on YouTube, like and subscribe and all that stuff. So we'll figure it out. Or if you wanna tell us how to do it, drop us a line. You can always go to the website, gonemobile .io and leave feedback one of the many ways. If you have episode ideas, I don't think we're too short on them yet, but you know, never a bad idea to consider a topic that maybe we haven't covered or thought of covering, so send us some info. I think that'll do it for today. See you later. Thanks for listening. Allan Ritchie (01:09:16.525) Bye everybody.