Posts

Donate

WPF MVVM - How To Pass ViewModel Or Element As ConverterParameter Value In XAML Code

Image
Good evening! In this post, I will demonstrate on how to pass a view model or an element as ConverterParameter value in XAML. This methodology is widely used by developers if you need to retrieve certain values or properties from a view model object or element. To send the view model data context as ConverterParameter value, reference the view model class in the data context node of your form or user control. <UserControl d:DesignHeight= "450" d:DesignWidth= "800" > <UserControl.DataContext> <localmain:ConfigurationResourceManagerViewModel x:Name= "vmResourceManager" /> </UserControl.DataContext> </UserControl> In your element as to where the ConverterParameter is, set it's value with the view model name. In the example snippet below, the ConverterParameter is used in the ComboBox SelectedItem property with a reference to the view model object. <DataGridTemplateColumn Header= "Resource

Xamarin Forms Project - Project Not Selected To Build For This Solution Configuration

Image
Hello and Happy Easter! A while ago I was downloading some Xamarin Forms projects from Github for testing and research purposes. Upon running the projects, it won't show on the Android emulator and in the Visual Studio IDE, a notification shows that the project was skipped in deployment with a detailed statement like "Project Not Selected To Build For This Solution Configuration" . I found the solution which is to right click on the Solution of the project -> Select Configuration Manager. If you notice, the Deploy checkbox is unchecked. Changing the state to checked solved the issue. I can now run the projects using the Android emulator. Cheers!

How To Use Samsung Galaxy Mobile Phones Pop-up View Feature

Image
Good day, A cool feature of Samsung Galaxy mobile phone series is the pop-up view of applications. This enables the user to open multiple applications and set an application as either background or in pop-up view mode. An example scenario is you're currently doing light exercises at home. You may open a Youtube application playing your favorite zumba or aerobics music compilations and another app such as StopWatch set as the pop-up view in order to monitor the timeframe of a particular exercise. To use the pop-up view feature,open at least two applications like Youtube or Clock. Switch to the Youtube app and make it as the current application running. Press the Recent Apps button of your phone encircled in Red for you to select the app as the pop-up. Select and press the Clock app and drag it to the Youtube app. A Drop here for pop-up view empty container appears as to where you will drop the program. Drop the Clock application into that empty container. The layout of

XAML Hot Reload Is Disabled Because It Requires Xamarin.Forms 5.0.0.2012 Or Newer -In Visual Studio 2019

Image
Hello, I downloaded a couple of Xamarin Forms applications written in Visual Studio 2017 and debugged them using Visual Studio 2019. When running these projects, a notification appears below the toolbar that says "XAML Hot Reload Is Disabled Because It Requires Xamarin.Forms 5.0.0.2012 Or Newer". I then proceed with Updating the Xamarin.Forms Packages for these projects and another issue came up which is "The $(TargetFrameworkVersion) for Project_name.Android (v8.1) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0)." . The solution to this error led me to StackOverflow that is to change a couple of Application and Application Manifest settings for the Android project. Changing the Compiled using Android version and Target Android version made the error go away. Application Tab. Change the Android version target from Android 8.1 to Android 11. Application Manifest Tab. Change the Android version target from Android 8.1

Insufficient Data For An Image Error - Printing PDF Books Using ImageSharp And PdfSharpCore In C#

Image
Hello and Good Day! As we continue to optimize our catalog software specifically printing of pdf books module, some of our catalogs were printed smoothly and other were not which specifically throws an Insufficient Data For An Image error when opening those books. I tried different solutions in .NET but none of them seem to resolve the problem. After investigating the images, we discovered that these photos which happens to be the templates for our books, were created using different types of graphics and CAD software. What we did was to open these images in Adobe Photoshop and save those files so that these photos program property is consistent. Since the error still persists, the next step I did was to change the image property in Photoshop specifically the Color Representation that has a value of Uncalibrated. In Photoshop, Uncalibrated is equivalent to Grayscale. Changing the image's Grayscale/Uncalibrated to RGB Color in Photoshop solved the Insufficient Data For A

PdfSharpCore And ImageSharp - Memory Keeps Increasing Or Memory Leak When Adding Hundreds Of Images To Create PDF Book

Image
Good day everyone! We are currently upgrading our WPF Cataloging application that has a feature to generate pdf books with multiple pages on the fly and each book may contain thirty or more images and may reach even a hundred from .NET Framework to .NET 7. Upon printing of a book,we discovered that it consume lots of memory even reaching to 5GB per book. Because our logic in generating a catalog involves adding texts and loading several images in memory and then print those details on a single pdf file, it may have caused to memory usage to skyrocket at a tremendous result. The code below shows how we load images using PdfSharpCore and ImageSharp. private ImageSource.IImageSource GetImageFromList<TPixel>( string key, string which, string name) where TPixel : unmanaged, IPixel<TPixel> { ImageSource.IImageSource rtn; int width; int height; width = 0; height = 0; if (ImageList.ContainsKey(key)) { rtn = ImageList[key]; } else { if (Ima

Xamarin Forms - Waiting for the emulator is ready In Visual Studio 2019

Image
Hello, I've experienced this error lately when running my Xamarin Forms project. The emulator loads on screen without the UI and in Visual Studio's output window, it says Waiting for the emulator is ready. It's just like waiting for the emulator to load forever. After trying out some accepted solutions, deleting and adding back the emulator works for me. First is to open the Android Device manager in Visual Studio IDE. Go to Tools Menu -> Android -> Android Device Manager. Delete the existing emulator and add it back again. In my current setup it's " Pixel 2 Pie 9.0 - API 28 ". After deleting and adding back the emulator, my Xamarin Forms app shows in the emulator. Cheers!

Vue 2 Charts (vue-chartjs v4) Not Working In Quasar Framework Project Version 1x

Image
Hello, We have a new sprint to work with that is to add metrics module to an existing project with tabular and charts. Since this is a legacy version of Quasar project, we need to add an old version of charts plugin also. There were lots of chart plugins to choose from but the team had the experience working with chart.js before in ASP.NET MVC projects and so we opt to select vue-chartjs as such. However, getting the plugin to work with the legacy Quasar project is a pain in the butt. I had to research in the forums and stackoverflow to make it work since the commands to install vuechart-js does not work on our app. After researching and experimenting for several hours, I came up with the solution that is to specify the versions of vue-chartjs and the chart.js during installation npm i vue-chartjs@4.1.2 chart.js@3.9.1 . After that, we can now fully utilize the features of vue-chartjs v4. The Quasar project that we are working has the following versions: Quasar: 1.2.2 Vue.js: 2

Turn On Samsung Galaxy Note 10 Lite Edge Lighting

Image
Good day! After updating my Samsung Galaxy Note 10 Lite mobile phone from Android 12 to Android 13, I need to enable the Edge Lighting again. To do this go to Settings -> Notifications -> select Notification pop-up style. Select Brief -> Edge Lighting Style From there, you can choose an Edge Lighting style based from the templates provided. For this to work with Facebook Messenger, open your messenger app and go to Settings -> Notifications & Sounds. Toggle/switch on the 'Show as pop-up' feature. That's it!

How To Enable Notepad++ Editor Dark Theme Mode In Windows 10 Or Windows 11

Image
Hello, I've just downloaded the latest updates of my Notepad++ editor and randomly checked the settings menu if there are added features that I can play with. After exploring the settings menu, one of the things I noticed is that I can now change the theme of the editor for light to dark. To do that, go to Settings -> Preferences -> Dark Mode. By default, Light mode is enabled. Switching from Light to Dark mode changes the background color/theme to something darker which is preferable by most users. Cheers!

Donate