Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

Leif Simon Goodwin

@Leif Simon Goodwin
About
Posts
111
Topics
34
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Forcing the views to update in ASP.NET Core 3.1.10
    L Leif Simon Goodwin

    I have an Asp.Net Core web application with some simple pages. I have a shared layout with the page content rendered as follows:

                        @RenderBody()
    

    The problem is that when I make changed to the content, they don't appear when I debug the web site, which means that it is impossible to for me to work on the web site. I found some suggested fixes online. I updated the startup as follows:

        public void ConfigureServices(IServiceCollection services)
        {
            System.Data.Common.DbProviderFactories.RegisterFactory("System.Data.SqlClient", System.Data.SqlClient.SqlClientFactory.Instance);
            var mvcBuilder = services.AddControllersWithViews();
    

    #if DEBUG
    if (IWebHostEnvironment.IsDevelopment())
    {
    mvcBuilder.AddRazorRuntimeCompilation();
    }
    services.AddRazorPages().AddRazorRuntimeCompilation();
    #endif
    services.Add(new ServiceDescriptor(typeof(Services.IKeyManagerFactory), new Services.KeyManagerFactory()));
    services.AddMvc();
    }

    But that doesn't help. I have tried other suggested fixes with no joy. For example in the startup Configure method:

            app.UseStaticFiles(new StaticFileOptions()
            {
                OnPrepareResponse = context =>
                {
                    //context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store");
                    context.Context.Response.Headers\["Cache-Control"\] = "no-cache, no-store, must-revalidate, max-age=0";
                    context.Context.Response.Headers.Add("Expires", "-1");
                }
            });
    

    How do I force the views to update?

    .NET (Core and Framework) asp-net help question csharp dotnet

  • Design questions about asp.net core website and asp.net core webapi
    L Leif Simon Goodwin

    You really should use an ORM such as PetaPoco or Dapper, it will make life much easier and less tedious. I found the former better as it worked well with four different SQL providers with minimal work, I couldn’t get Dapper working with them all. Here is an example application: Example WPF SQL Database Application using PetaPoco ORM with SQLServer, SQLIte, MySQL and ProgreSQL[^] There are other examples online too.

    Web Development asp-net question csharp database dotnet

  • Design questions about asp.net core website and asp.net core webapi
    L Leif Simon Goodwin

    You should separate the database code from the controllers and views. I created a database class implementing an interface that is passed to the controllers, providing methods to obtain the required data from the database. Thus there is a minimal common interface between the web site and the database code, and the web site knows nothing about the database. This allows testing of the database code with a desktop test harness. It also allows easy replacement of the database code if for example I change database provider. I used Dapper for database access, but PetaPoco is better IMO.

    Web Development asp-net question csharp database dotnet

  • Update an ASP.NET Core website with thousands of JPG images takes ages
    L Leif Simon Goodwin

    I have two related questions. 1) I have an ASP.NET Core website hosted for me by WebWiz. The target location on the server for my web site files is /MyWebSite.org/public_html/. The web site contains thousands of JPG images and publishing takes a looooong time because Visual Studio has to FTP all of those images. Is there a way to configure so that it only uploads images not already present? 2) Publishing does an FTP to the MyWebSite.org/public_html/ folder. What happens when someone tries to browse the web site while it is being published? Can I publish to /MyWebSite.org/temp_public_html/ and then when it is complete, delete /MyWebSite.org/public_html/ and then rename /MyWebSite.org/temp_public_html/ as /MyWebSite.org/public_html/? As you can see, my knowledge of how IIS and web sites work is thin.

    Web Development csharp asp-net dotnet visual-studio sysadmin

  • Unable to make article available.
    L Leif Simon Goodwin

    Hi Sean. Any joy? It still refuses to allow me to update the article. Essentially it's just a new zip file and a release version note.

    Article Writing question announcement

  • Unable to make article available.
    L Leif Simon Goodwin

    Thank you.

    Article Writing question announcement

  • Unable to make article available.
    L Leif Simon Goodwin

    Yes it is.

    Article Writing question announcement

  • Unable to make article available.
    L Leif Simon Goodwin

    Over a day later and it still doesn't not work. The article is published, but there is a serious bug in the code which will annoy users. I was able to add a comment with the fix, but not update the article with a new ZIP file. The ZIP is less than 100 Kb so is fine sizewise.

    Article Writing question announcement

  • Unable to make article available.
    L Leif Simon Goodwin

    I get the above message when I try to update my article. Ideas? I had this happen on another article, after a week it allowed me to post the update, nothing had changed.

    Article Writing question announcement

  • Cannot update article
    L Leif Simon Goodwin

    I am having huge problems updating articles. Today I edited an article, uploaded a new ZIP file, pressed the Add Selected to Article button, and nothing happened. I discarded the changes, renamed the file and uploaded it again, no joy. Please how do I upload a new file and insert a download link? Last week I had huge problem submitting changes, it kept saying it could not do it. I tried again today and it finally worked. The site seems to be having wobblies. Oh, and my last article was placed in a really weird section. I selected Database / Database / Ado and it was put into COM,COM+ / General.

    Site Bugs / Suggestions question database com help announcement

  • Dock pane manager question
    L Leif Simon Goodwin

    Interesting point, thanks. I decided to go with themes, it actually makes the code easier, and users generally don’t need to tinker.

    Free Tools csharp wpf question help announcement

  • Dock pane manager question
    L Leif Simon Goodwin

    I’ve created a WPF C# docking pane manager for my own use which will be free for others to use. It will be posted on this web site along with my other free utilities. I used AvalonDock for a commercial project, and although it’s really powerful I found it rather complicated to tweak, and failed to make some desired changes, hence my own version. It is finished apart from the settings for the appearance. I see two ways to do this. The first way is to allow the user to change pretty much any aspect of the appearance such as the corner radius, and the border thickness and brush for panes. The application would come with a canned style that can be changed by the user. I’ve created a dialog that allows just that, so if the font is too small, no problem, the user can change it. If they are colour blind, they can change the pane header colour, or the border colour. There is also support for programmatically overriding the templates for icons, the side bar and so on so that the application developer can add their own branding and make it look like a MegaCorp (TM) product. I’ve added a mechanism so that the user can save their settings as a ‘theme’, and load the preferred theme whenever they want, though they’ll probably just create one personal theme. The second way is to implement themes as intended by Microsoft. Thus the user is given a selection of themes, and loads the one they prefer. This is an all or nothing approach. They can’t tweak the font size, or the pane border colour, they can only choose between one or more hard coded themes, each with it own fixed values for the borders, the brushes and so on. I much prefer the first approach, it’s perhaps unconventional but it’s more useful for the user in my opinion as it gives them far more control. What do other people think? If you have created a product around a dock pane manager, would you be okay with the first way, or are you strongly in favour of the second? Does the ability to undo your branding (colour scheme) annoy you? I suppose it could be the second approach, but with an adjustable font size.

    Free Tools csharp wpf question help announcement

  • Detect the end of a window drag in WPF and WindowChrome
    L Leif Simon Goodwin

    I have a main application window and a floating WPF window. The user can drag the floating window over the main window in order that it docks. I need to detect the end of the drag operation. How do I do this? I am using Window Chrome to allow me to insert a drop down menu into the floating window's title bar. The usual way to detect a drag end is to wait for the WM_WINDOWPOSCHANGED message. Unfortunately Window Chrome seems to prevent this being sent. (It is sometimes sent, but not always.) I can enable hit tests for the window but that disables drag operations. Of course I can detect the LocationChanged event, but that is sent during a drag and not at the end. I could start a background thread on the first LocationChanged event to monitor when the mouse left button is not pressed (via a user32 call). I have tested this and it works, but it seems a bit clunky. I have hooked into the window's message loop but there is nothing that is of use. WindowChrome seems to filter out many messages especially in the non client area, and messages for the mouse key down and up are not sent.

    C# question csharp wpf learning

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    Get lost. :mad:

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    I accidentally marked your post as trolling. Apologies for the error, your posts are constructive. :sigh:

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    Probably not for reasons of commercial secrecy. What I am working on has NDA agreements in place. However, the current implementation now works well. We generate and compile the form code on the fly, and the form runs pretty quickly to provide a decent user experience. I am using the extended WPF toolkit DataGrid in place of the standard DataGrid which has solved the performance issues. From searching on the internet, it's clear that the performance of data grids is an issue for a lot of people, and I am sure many have their own custom implementations. I might be able to significantly reduce the memory footprint, and increase execution time but it would require significant development time which we do not have. We need to focus on the features that our customers will use, rather than gold plate something used from time to time by a couple of our own engineers.

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    Are you always so completely obnoxious? :mad: You come across as a troll. Every single one of your posts is a put down. The suggestions you make are vague abstract comments (the kind that someone with no real knowledge could make), with no helpful content and nothing to indicate any actual technical knowledge on your part. Do you have anything constructive to say or is your goal simply to piss on me? Frankly I am getting pissed off with your obnoxious trolling. :mad: The layout was designed by the engineers. It's what they have asked for and what they want. They've seen the current prototype and like it. It's the same as in the previous application which has served them well.

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    This is the design requested by the firmware engineers including the technical director, and does all that they need. They have the same layout in the current application, which the new one replaces.

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    This is the design requested by the engineers including the technical director. It's the one they use in the current application (which the new one replaces).

    WPF wpf performance csharp wcf data-structures

  • WPF DataGrid uses a lot of memory, or is slow to scroll
    L Leif Simon Goodwin

    I agree. However, this is an application for engineers rather than general consumers, and this particular view displays configuration settings that will only be examined by two or three people who are based in our company (super users). The values are rather abstruse, and control fine details of a display device. Most of the time users will just examine the values, and maybe tweak one or two. For general editing we stream the data to and from a .CSV file. So in practice this horrible view will be okay.

    WPF wpf performance csharp wcf data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups