code-behind Questions

3

Solved

I'm a student learning C# with WPF using the MVVM pattern. Recently I have been working on a [art of my application (a custom splash screen) that should not be closed when I don't want it to. I hav...
Oakie asked 6/6, 2013 at 22:38

5

Solved

I have created a Window which has a ListView to display a collection of persons. There are also 3 TextBoxes that are supposed to display the person's first and last name, and an age. Finally, there...
Province asked 6/4, 2011 at 20:30

7

Solved

I'm trying to follow the MVVM pattern in a WPF application as good as I can, mainly to be able to create unit tests for my ViewModel logic. In most cases data binding between ViewModel properties ...
Taxicab asked 2/4, 2011 at 16:34

12

Solved

I have a Blazor (Server) application which runs perfectly fine, and which adheres to all rules set by Microsoft.CodeAnalysis.FxCopAnalyzers and StyleCop.Analyzers. A heavily cut-down razor page is ...
Byer asked 26/11, 2019 at 12:43

4

Solved

I need to create a WPF grid dynamically from code behind. This is going okay and I can do it so that I set the content widths but what I need to do is set them so that when i resize the window the ...
Burgett asked 15/3, 2012 at 13:46

8

Solved

I want to call CsharpFunction, a C# function in code-behind, from JavaScript. I tried the code below but whether the JavaScript condition is True or False, CsharpFunction was called regardless! Ja...
Hocker asked 26/8, 2013 at 9:44

2

Solved

I am trying to embed a PNG graphic into a DLL and load it into an Image control as a BitmapImage. However, WPF keeps throwing an exception saying that the resource cannot be found. First, some min...
Hangup asked 9/1, 2014 at 14:17

5

Solved

I have a template defined in a XAML file named 'MyTemplate.xaml'. This template is using a code-behind file named 'MyTemplate.cs'. Mytemplate.xaml: <ResourceDictionary x:Class="Project.Templat...
Photomultiplier asked 8/8, 2013 at 8:38

7

common problem I guess, but no solution has worked so far: my breakpoints (asp.net 2.0) get hit nicely in "backend" assemblies but not in the code behind. i can even see the <% Response.Cach...
Stoecker asked 19/5, 2011 at 13:2

5

Solved

For my Xamarin Forms project (latest version 1.3), when I create a view in Xamarin Studio (latest, 5.5.4), I define the view as the following: <?xml version="1.0" encoding="UTF-8"?> <Cont...
Deccan asked 3/1, 2015 at 10:47

2

Solved

First of all, I have looked at the other related posts on StackOverflow.com and changing the path in the csproj file didn't make any difference in this warning as you will see below. Reference: why...
Maneuver asked 3/2, 2014 at 16:1

7

Solved

I am using aspx. If I have HTML as follows: <div id="classMe"></div> I am hoping to dynamically add a css class through the code behind file, ie on Page_Load. Is it possible?
Vinavinaceous asked 14/12, 2009 at 21:8

20

Solved

I got the following error: "An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file...
Algetic asked 21/7, 2012 at 22:30

7

Solved

I have a custom collection defined in my window resources as follows (in a Sketchflow app so the window is actually a UserControl): <UserControl.Resources> <ds:MyCollection x:Key="myKey"...
Stringpiece asked 22/1, 2010 at 14:30

3

Solved

I have a WPF application that has a few legacy panels that were written mostly with code behind. I need to set the AutomationProperties.AutomationId for the controls on the panel. For example, this...
Anabolite asked 13/7, 2014 at 0:40

4

I need to access the scrollviewer of a listview from the codebehind. here is the definition of my listview <ListView Grid.Row="1" ItemsSource="{Binding Path=SpecList, UpdateSourceTrigger=Proper...
Unmeaning asked 27/3, 2017 at 17:57

1

Solved

When I create a new Razor page in Visual Studio 2017, the separated code behind file did not get created. This is the screenshot of the problem highlighted. We can see the Razor page called Lis...

2

Solved

I have the following Xaml that is used in a user control that used as an editor inside a property grid. The question is, what would the c# look like to attach a behavior from the code behind? <...
Idyllist asked 2/5, 2012 at 22:7

3

Solved

I have a gridview that gets created in codebehind. In the below code, I would like to have 3rd column to be some image (Example: PDF icon or similar). I am thinking Type.GetType needs to be chang...
Paske asked 2/11, 2011 at 16:5

20

Solved

I don't like to use XAML. I prefer to code everything in C#, but I think that I am doing things wrong. In which cases it is better to use XAML and when do you use C#? What is your experience?
Platelet asked 16/6, 2009 at 16:30

13

Solved

In an asp.net windows forms application, in the C# code behind you can use: MessageBox.Show("Here is my message"); Is there any equivalent in a asp.net web application? Can I call something fro...
Berti asked 15/3, 2012 at 12:55

18

Solved

I have a web application that I'm working on (ASP.NET 2.0 with C#, using Visual Studio 2005). Everything was working fine, and all of a sudden I get the error: Error 1 The name 'Label1' does not e...
Trample asked 1/4, 2009 at 17:34

5

Solved

I want to produce in code the equivalent of this in XAML: <TextBlock Text="Title:" Width="{Binding FormLabelColumnWidth}" Style="{DynamicResource FormLabelStyle}"/> I can do the text and t...
Vulcanize asked 18/11, 2009 at 9:4

6

Solved

I'm working with HTML provided by coworker in .aspx and I need to program in .aspx.cs(C#) the functionality of the button he created using HTML. The code I'm dealing with is as follows: <div&gt...
Freya asked 14/6, 2017 at 14:7

5

Solved

At the article, WPF Apps With The Model-View-ViewModel Design Pattern, the author who is Josh Smith said: (1) In a well-designed MVVM architecture, the codebehind for most Views should be empty,...
Stgermain asked 21/6, 2011 at 6:43

© 2022 - 2024 — McMap. All rights reserved.