{"id":640,"date":"2016-11-23T12:47:04","date_gmt":"2016-11-23T12:47:04","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=130"},"modified":"2022-09-13T15:50:02","modified_gmt":"2022-09-13T14:50:02","slug":"create-new-class","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/classes-uwp-programming-in-c\/create-new-class","title":{"rendered":"Create New Class"},"content":{"rendered":"<h4>\n\tCreating a new class<\/h4>\n<p>Menu &gt; Project &gt; Add Class<\/p>\n<h5>\n\tIn the new .cs&nbsp;file add the following:<\/h5>\n<p>The namespace can be a distinct name, or for classes that are part of a main ap you can just use the ap\u2019s namespace name.<\/p>\n<pre><code>\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\/\/----- NOTES -----\n\/\/\n\/\/USING THIS CLASS IN A PROJECT:-\n\/*\n\/\/USING NAMESPACES\n\tusing OurLibraries;\n\/\/IN YOUR DECLARATIONS:\n\tprivate MyClass MyClass1;\n\/\/IN YOUR CONSTRUCTOR\n\tMyClass1 = new MyClass();\n\/\/START USING\n\tMyClass1.#();\n*\/\n\nnamespace OurLibraries\n{\n\tclass MyClass\n\t{\n\t\t\/\/--------------------------\n\t\t\/\/----- PUBLIC DEFINES -----\n\t\t\/\/--------------------------\n\t\t\/\/public \n\n\t\t\/\/---------------------------\n\t\t\/\/----- PRIVATE DEFINES -----\n\t\t\/\/---------------------------\n\t\t\/\/private \n\n\t\t\/\/--------------------------\n\t\t\/\/----- PUBLIC OBJECTS -----\n\t\t\/\/--------------------------\n\t\t\/\/public \n\t\n\t\t\/\/---------------------------\n\t\t\/\/----- PRIVATE OBJECTS -----\n\t\t\/\/---------------------------\n\t\t\/\/private \n\n\t\t\n\t\t\/\/*********************************\n\t\t\/\/*********************************\n\t\t\/\/********** CONSTRUCTOR **********\n\t\t\/\/*********************************\n\t\t\/\/*********************************\n\t\tpublic MyClass()\n\t\t{\n\t\t\t\n\t\t}\n\n\n\t}\n}\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a new class Menu &gt; Project &gt; Add Class In the new .cs&nbsp;file add the following: The namespace can be a distinct name, or for classes that are part of a main ap you can just use the ap\u2019s namespace name. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; \/\/&#8212;&#8211; NOTES &#8212;&#8211; [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[],"class_list":["post-640","post","type-post","status-publish","format-standard","hentry","category-classes-uwp-programming-in-c"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/640","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=640"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/640\/revisions"}],"predecessor-version":[{"id":1198,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/640\/revisions\/1198"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}