Questions tagged [partial-classes]

With this keyword classes can be split into multiple definitions, but it compiles into one class.

With this keyword, classes can be split into multiple (mostly two) definitions, but the code compiles into one run-time class.

References

441 questions
-2
votes
2 answers

How to make Window var global

I am using a piece of code that allows me to edit another window, e.g. a textbox located inside: var MessageBox_Window = System.Windows.Application.Current.Windows.Cast().FirstOrDefault(window => window is MessageBoxWindow) as…
Callum Watkins
  • 2,844
  • 4
  • 29
  • 49
-3
votes
1 answer

partial class constructor not calling the base

MyClass.cs: namespace ConsoleApp { public partial class MyClass { public string Name { get; set; } public MyClass() { Name = "base"; } } } MyClass2.cs: namespace ConsoleApp { public partial class MyClass { …
Johnny Wu
  • 1,297
  • 15
  • 31
-3
votes
1 answer

Is there any way to Write same property name in partial class in C#?

My Auto Generated Class public partial class Address { public int Id { get; set; } public string Name { get; set; } } And I want following output. And I don't take same property name in my partial class. so how can i achieve my result? is…
Karan Rana
  • 11
  • 1
-3
votes
1 answer

Partial Class Inherits Base Class

I need to change the Inherits statement in my class initialization file to Inherits FileSystemWatcher but I have found that this disables the System.Windows.Forms.Form references in my file and gives me debug errors for missing method…
KGCole
  • 11
  • 7
-3
votes
3 answers

How do I use a variable outside of a partial class?

I'm new to C#, and I'm new to the idea of "partial" classes. I wish to access the "grid" variable outside of this "MainWindow" class. How would I go about doing that?
MrDysprosium
  • 489
  • 9
  • 20
-3
votes
1 answer

C# How to return string instead of DateTime using Partial class

In my silverLight project I have a class on web side with few DateTime fields. I want to write Partial class for the class on client side which will return string instead of DateTime. How to write it? This is what I tried. I added new string…
DoctorAV
  • 1,189
  • 1
  • 14
  • 40
1 2 3
29
30