Ofelia Yeoh
About
-
Posted Answers
Answer
An anniversary is the date on which an event took place or an institution was founded in a previous year, and may also refer to the commemoration or celebration of that event. The word was first used for Catholic feasts to commemorate saints.
Most countries celebrate national anniversaries, typically called national days. These could be the date of independence of the nation or the adoption of a new constitution or form of government. There is no definite method for determining the date of establishment of an institution, and it is generally decided within the institution by convention. The important dates in a sitting monarch's reign may also be commemorated, an event often referred to as a "jubilee".
The Latin phrase dies natalis (literally "birth day") has become a common term, adopted in many languages, especially in intellectual and institutional circles, for the anniversary of the founding ("legal or statutory birth") of an institution, such as an alma mater (college or other school). In ancient Rome, the Aquilae natalis was the "birthday of the eagle", the anniversary of the official founding of a legion.
Anniversaries of nations are usually marked by the number of years elapsed, expressed with Latin words or Roman numerals.
Latin terms for anniversaries are mostly straightforward, particularly those relating to the first thirty years (1–30), or multiples of ten years (30, 40, 50, 60, 70 etc.), or multiples of centuries or millenniums (100, 200, 300, 1000, 2000, 3000, etc.) In these instances, the name of the anniversary is generally derived from the Latin word(s) for the respective number of years. When anniversaries relate to fractions of centuries (125, 150, 175, 225 years—i.e. 1.25, 1.5, 1.75, and 2.25 centuries), the situation is not as simple.
Roman fractions were based on a duodecimal system. From 1⁄12 to 8⁄12 they were expressed as multiples of twelfths (uncia "twelfth"; the source of the English words inch and ounce) and from 9⁄12 to 11⁄12 they were expressed as multiple twelfths less than the next whole unit—i.e. a whole unit less 3⁄12, 2⁄12 or 1⁄12 respectively. There were also special terms for quarter (quadrans), half (semis), and three-quarters (dodrans). Dodrans is a Latin contraction of de-quadrans which means "a whole unit less a quarter" (de means "from"; quadrans means "quarter"). Thus for the example of 175 years, the term is a quarter century less than the next whole (bi)century or 175 = (−25 + 200).
In Latin, it seems that this rule did not apply precisely for 1+1⁄2. While secundus is Latin for "second", and bis for "twice", these terms are not used such as in sesqui-secundus. Instead sesqui (or ses) is used by itself.
Many anniversaries have special names. Etiquette in Society, in Business, in Politics and at Home by Emily Post, published in 1922, contained suggestions for wedding anniversary gifts for 1, 5, 10, 15, 20, 25, 50, and 75 years. Wedding anniversary gift suggestions for other years were added in later editions and publications; they now comprise what is referred to as the "traditional" list. Generally speaking, the longer the period, the more precious or durable the material associated with it.
There are variations according to some national traditions. There exist numerous partially overlapping, partially contradictory lists of anniversary gifts (such as wedding stones), separate from the 'traditional' names. The concepts of a person's birthday stone and zodiac stone, by contrast, are fixed for life according to the day of the week, month, or astrological sign corresponding to the recipient's birthday.
Answer is posted for the following question.
Answer
If you're a Kansas City native, you know about Pigwich They have the BEST sandwiches in town
Answer is posted for the following question.
Which is best date night in Kansas City?
Answer
In Norfolk County, MA 670% of the people voted Democrat in the last presidential election , 307% voted for the Republican Party, and the remaining 22% voted
Answer is posted for the following question.
How did weymouth vote?
Answer
One of the reasons that Microsoft failed to get wide spread adoption of the Universal Windows Platform (UWP) is that there is already a massive investment into Windows Forms (WinForms) and Windows Presentation Foundation (WPF) applications. What’s ironic is that this is true for both existing applications and new applications. Over the last couple of years Microsoft has changed strategy and has been looking at tools and techniques for bridging the gap between these frameworks in order to allow developers to take advantage of the rich controls and capabilities of UWP. In this post we’re going to walk through how you can use XAML Islands to host UWP controls within an existing WinForms or WPF application.
Before we get into working with XAML Islands, here are a couple of reference posts that are worth a read if you want to understand the background and some additional details about XMAL Islands:
Let’s get into this – we’re going to start with Windows Forms and we’re going to be working with a Windows Forms application that’s sitting on .NET Core 3.1. As Miguel discusses in his post, there is support for .NET Framework but there are some limitations for third party controls. If your application is still based on .NET Framework, I would highly recommend looking at migrating to .NET Core.
In Visual Studio, we’ll create a new project using the Windows Forms (WinForms) Application project template. I’m currently using Visual Studio 2019 16.8 preview 2.1 where the project templates have been renamed – this template was formerly called Windows Forms App (.NET Core), which points to Microsoft’s intent to move developers to building Windows Forms app off .NET Core instead of .NET Framework (the .NET Framework based template is still called called Windows Forms App (.NET Framework)).
We’re going to select .NET Core 3.1 for the target framework
After creating the project we’ll rename Form1 to MainForm, and then proceed with adding four more forms that will host the four scenarios we’re going to look at.
Next I’ll create four buttons on the MainForm, which we’ll use to launch the four forms we just created.
The code behind for these buttons is relatively simple.
Now let’s start with the first scenario where we’re just going to display a standard UWP Button inside the SimpleButtonForm. To do this, the first thing we need to do is to reference the Microsoft.Toolkit.Forms.UI.XamlHost NuGet package.
Next, we’re going to add code in the SimpleButtonForm constructor to create the instance of both the Button and the WindowsXamlHost. The WindowsXamlHost is the wrapper that makes it really easy to add UWP based controls to the Windows Forms application.
Important Note: If we run the application at this point we’ll see an error shown in the following image, that reads “WindowsXamlManager and DesktopWindowsXamlSource are supported for apps targeting Windows version 10.0.118226.0 and later”.
To fix this issue we need to include an app.manifest file with the following content:
The app.manifest file needs to be set as the Manifest file for the Windows Forms project via the Application tab of the Project Properties (Right-click on the project in Solution Explorer and select Properties).
Now, we can run the application, click on the button entitled “Simple UWP Button” and then click on the Say Something button.
What we’ve seen so far is simply using the built-in UWP controls. If you want to use your own custom controls, or third party controls, you’ll need to follow some additional steps.
For the custom control scenario, let’s start by creating a new project based on the Class Library project template. Note that you could also use a UWP class library for this and follow the same steps.
In order to add UWP controls to the class library, we’ll update the project file to use the uap10.0.16299 target framework (this step isn’t required if you’re use the UWP class library project template).
Our custom control is going to be very basic with a single Button that’s going to generate a random number that’s displayed in a TextBlock.
With very simple code behind
Referencing our control isn’t a simple as just adding a project reference to our class library. Instead, we need to provide a context in which our control is going to be instantiated. When our control gets created in a normal UWP application, it does so within the context of the application, which allows for resolution of resources, styles etc. We need to provide a similar context for our control when it’s rendered within a Windows Forms application.
To do this, we need to create a new project based on the Blank App (Universal Windows) project template. I would avoid attempting to use either a UWP class library or multi-targeted class library for this as neither of them will generate the necessary output for the hosting of our custom control in a Windows Forms or WPF application.
In creating the new project, make sure you select 10.0.18362 (version 1903) as the minimum version.
We then need to add a reference to the Microsoft.Tookit.Win32.UI.XamlApplication NuGet package to the UWP application project.
The UWP application needs to reference the control library.
And the Windows Forms application needs to reference both the UWP application and the control library.
Now we can go ahead and add the code to the CustomControlForm to add an instance of the MyCustomControl.
At this point if you try to run the Windows Forms application you’ll see build errors similar to the following
or
The errors are pointing to a disparity between the platforms that the projects are being built for. To work around this, you need to change the Platform for each project to be consistent. Right-click on the solution in Solution Explorer and select Configuration Manager. For each platform, make sure the same Platform is selected. This may mean that you have to create a new configuration for those projects that only have Any CPU, such as in this example.
From the New Project Platform dialog, select the platform and make sure the “Create new solution platforms” option is unchecked.
With this done, we should be able to run the application and click on the Custom Control button to launch the CustomControlForm that hosts the MyCustomControl. In this case the MyCustomControl encapsulates the functionality for handling the Button click and updating the Text on the TextBlock.
In this scenario we’re going to reference the Telerik UWP control library (Telerik.UI.for.UniversalWindowsPlatform on NuGet) and make use of the RadCalendar. The first step is to simply add the reference to the NuGet package. I’m going to go ahead and add it to both the Windows Forms project, as well as both the UWP application and class library projects.
With the reference added, we can simply create an instance of the RadCalendar inside the constructor of the ThirdPartyControlForm.
And without any further changes, we can go ahead and run the Windows Forms application and click on the Third Party Control button. This will show the ThirdPartyControlForm with the RadCalendar visible.
The last scenario also makes use of the RadCalendar. This time we’re going to combine it with other Windows Forms controls to illustrate how you can use data binding and apply styles.
To begin with we’re going to use the Windows Forms designer to put together a basic layout. Unfortunately even though the WindowsXamlHost control appears in the Toolbox, an exception is thrown by Visual Studio when attempting to add it directly to the Form. Instead, I’ve added a Panel which will act as a placeholder for the WindowsXamlHost, and subsequently the RadCalendar.
I’ve also added a Windows Forms DateTimePicker and a Label. The idea is that the user should be able to use either the RadCalendar or the DateTimePicker to select a date, which will be displayed in the Label below.
We’ll add a very simple class that will be used for data binding.
In terms of data binding to the RadCalendar, we have a couple of options. We could manually create the data binding expression. This seems quite archaic, so alternatively we can specify the binding in XAML. However, this only works if the instance of the RadCalendar is being created in XAML, so that we can specify the binding expression. Easily done – by creating a CustomCalendar UserControl in our Control Library, with the following XAML.
Note that in this case, being able to do the binding in XAML is particularly useful since we need to create and use an instance of the CalendarDateToSingleDateRangeConverter. This converter allows for binding a single DateTime property (MyDate) to the SelectedDateRange property.
Back to the Windows Forms project, the code for creating the instance of the CustomCalendar control and wiring up the data binding with the other controls on the page, looks like this.
Running the Windows Forms application and clicking on the Third Party Control With Style button shows the ThirdPartyControlWithStyleForm. Either the RadCalendar (nested in the CustomCalendar control) or the DateTimePicker can be used to select a date, which is shown in the Label below.
You’ll notice that the selected date in the RadCalendar has a different style applied with a green background and red border. This has been applied using an implicit style defined in the App.xaml in the UWP application project.
That’s it for the Windows Forms application – four different scenarios for hosting UWP controls in a Windows Forms application using Xaml Islands.
Now we’ll move on to showing the same four scenarios in a WPF application. As we’ve already done a lot of the setup work for the various controls, this section will focus on the differences with the hosting in WPF. To get started we’ll use the WPF Application project template.
Like we did for the Windows Forms application, we’ll create four additional Windows and connect them to four buttons on the main Window of the application.
We’ll need to reference the Microsoft.Toolkit.Wpf.UI.XamlHost NuGet package.
You’ll also need to add an app.manifest file and set it as the manifest file for the WPF application.
The XAML and code behind for the SimpleButtonWindow are as follows.
Running this and clicking the Simple UWP Button, we see a new Window appear that’s similar to the Windows Forms example.
Adding the Custom Control is actually even simpler, as we can just specify the MyCustomControl using the InitialTypeName property. Don’t forget to add references to the UWP application and class library projects.
Again, this looks very similar to the Windows Forms output.
The ThirdPartyControlWindow is very similar to the CustomControlWindow in that we can just specify the InitialTypeName attribute. In this case using the class Telerik.UI.Xaml.Controls.Input.RadCalendar.
The ThirdPartyControlWithStyleWindow is slightly more complex as we need to establish the data binding. Here’s the XAML and code behind.
Notice how simple this is – the DataContext is applied to both the WPF and UWP controls, making it possible to easily integrate controls from both frameworks into the same layout with minimal fuss.
Answer is posted for the following question.
How to use uwp control in wpf?